From 4f8e3d026e7116078fdcdf48cda6bdffe614e869 Mon Sep 17 00:00:00 2001 From: FrankZamora Date: Tue, 4 Nov 2025 21:48:08 -0600 Subject: [PATCH] Agregar cache busting con filemtime() para CSS de FASE 2 y FASE 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Problema:** Cache del servidor impidiendo visualización de cambios CSS **Solución Implementada:** 1. **Cache del Servidor Limpiado:** - ✅ W3 Total Cache: `/var/www/preciosunitarios/public_html/wp-content/cache/*` eliminado - ✅ PHP OPcache: `opcache_reset()` ejecutado exitosamente - ✅ Nginx: Sin módulo de cache activo 2. **Cache Busting Agregado:** - Reemplazado `APUS_VERSION` por `filemtime()` en enqueue de CSS - Afecta 8 archivos CSS modificados en FASE 2 y FASE 3: - buttons.css (FASE 2) - hero.css (FASE 2) - badges.css (FASE 2) - pagination.css (FASE 2) - post-content.css (FASE 2) - related-posts.css (FASE 2) - toc.css (FASE 3) - cta-box-sidebar.css (FASE 3) **Cambios en enqueue-scripts.php:** - **Línea 90:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/buttons.css')` - **Línea 99:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/hero.css')` - **Línea 108:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/badges.css')` - **Línea 117:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/pagination.css')` - **Línea 127:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/post-content.css')` - **Línea 136:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/related-posts.css')` - **Línea 292:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/toc.css')` - **Línea 453:** `APUS_VERSION` → `filemtime(get_template_directory() . '/assets/css/cta-box-sidebar.css')` **Resultado:** - Cada vez que se modifique un archivo CSS, `filemtime()` generará un timestamp único - Navegadores forzados a recargar CSS actualizado (no cache) - URLs generadas: `buttons.css?ver=1730858400` (timestamp UNIX) **Validación:** - ✅ Sintaxis PHP: Sin errores - ✅ W3 Total Cache: Limpiado en servidor - ✅ PHP OPcache: Limpiado en servidor **Instrucciones Post-Deploy:** 1. Subir cambios al servidor con `git pull` 2. Refrescar navegador con Ctrl+F5 (hard refresh) 3. Verificar en DevTools que CSS se carga con nuevos timestamps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../themes/apus-theme/inc/enqueue-scripts.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-content/themes/apus-theme/inc/enqueue-scripts.php b/wp-content/themes/apus-theme/inc/enqueue-scripts.php index 30da6fff..fe9e1aa6 100644 --- a/wp-content/themes/apus-theme/inc/enqueue-scripts.php +++ b/wp-content/themes/apus-theme/inc/enqueue-scripts.php @@ -87,7 +87,7 @@ function apus_enqueue_fase2_styles() { 'apus-buttons', get_template_directory_uri() . '/assets/css/buttons.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/buttons.css'), 'all' ); @@ -96,7 +96,7 @@ function apus_enqueue_fase2_styles() { 'apus-hero', get_template_directory_uri() . '/assets/css/hero.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/hero.css'), 'all' ); @@ -105,7 +105,7 @@ function apus_enqueue_fase2_styles() { 'apus-badges', get_template_directory_uri() . '/assets/css/badges.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/badges.css'), 'all' ); @@ -114,7 +114,7 @@ function apus_enqueue_fase2_styles() { 'apus-pagination', get_template_directory_uri() . '/assets/css/pagination.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/pagination.css'), 'all' ); @@ -124,7 +124,7 @@ function apus_enqueue_fase2_styles() { 'apus-post-content', get_template_directory_uri() . '/assets/css/post-content.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/post-content.css'), 'all' ); @@ -133,7 +133,7 @@ function apus_enqueue_fase2_styles() { 'apus-related-posts', get_template_directory_uri() . '/assets/css/related-posts.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/related-posts.css'), 'all' ); } @@ -289,7 +289,7 @@ function apus_enqueue_toc_assets() { 'apus-toc-style', get_template_directory_uri() . '/assets/css/toc.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/toc.css'), 'all' ); @@ -450,7 +450,7 @@ function apus_enqueue_cta_box_sidebar_assets() { 'apus-cta-box-sidebar', get_template_directory_uri() . '/assets/css/cta-box-sidebar.css', array('apus-bootstrap'), - APUS_VERSION, + filemtime(get_template_directory() . '/assets/css/cta-box-sidebar.css'), 'all' ); }