Avisos
Vaciar todo

Add Expires headers  

 
Charly ll
 Charly ll
Usuario activo

He puesto en .htaccess este codigo y sigue diciendome el google y el yslow "Add Expires headers"

	ExpiresActive On
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType text/css "access plus 1 week"
	ExpiresByType text/javascript "access plus 1 week"
	ExpiresByType application/javascript "access plus 1 week"
	ExpiresByType application/x-javascript "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
	ExpiresByType image/svg+xml "access plus 1 year"
	ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
	ExpiresByType application/font-woff "access plus 1 year"
	ExpiresByType application/x-font-woff "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresByType font/opentype "access plus 1 year"
	ExpiresByType font/ttf "access plus 1 year"
	ExpiresByType font/otf "access plus 1 year"
	ExpiresByType application/x-font-ttf "access plus 1 year"
	ExpiresByType application/x-font-otf "access plus 1 year"

¿que estoy haciendo mal?

URL del sitio: Contenido solo visible a usuarios registrados

Citar
Respondido : 02/05/2017 6:58 pm
Jhon
 Jhon
Soporte CMS Webempresa Moderator

Hola

Posiblemente te falta imágenes jpg, veo que has puesto jpeg, agrega:

ExpiresByType image/jpg "access plus 1 month"

Si sigues con problemas envíanos alguna captura de pantalla para ver el mensaje que te aparece

Saludos.

ResponderCitar
Respondido : 02/05/2017 8:08 pm

wpdoctor-revisa-la-salud-de-tu-wordpress

Charly ll
 Charly ll
Usuario activo

añadí lo que me dicespero no hace caso, adjunto captura

ResponderCitar
Respondido : 02/05/2017 9:05 pm
Jhon
 Jhon
Soporte CMS Webempresa Moderator

Hola

En tu captura de pantalla veo que se hace referencia a elementos estáticos .jpg, agrega la línea que te indíque anteriormente

Saludos.

ResponderCitar
Respondido : 02/05/2017 11:02 pm

Gestor de Contraseñas - VPN Conexión Segura - Gestor 2FA (Segundo Factor de Autenticación

Charly ll
 Charly ll
Usuario activo

si, ya te dije que lo habia copiado y no hace nada, el resultado era la captura...

ResponderCitar
Respondido : 03/05/2017 1:34 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

El código lo estas pegando al principio del fichero .htaccess?

ResponderCitar
Respondido : 03/05/2017 4:45 am

optimiza-automaticamente-todas-las-imagenes-de-tu-wordpress

Charly ll
 Charly ll
Usuario activo

lo he puesto en varias posisciones:
ahora mismo lo tengo asi:

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
#  http://www.prestashop.com  -  http://www.prestashop.com/forums 


SecFilterEngine Off
SecFilterScanPOST Off


## EXPIRES CACHING ##

ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"

## EXPIRES CACHING ##





SetEnv HTTP_MOD_REWRITE On


RewriteEngine on


#Domain
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteRule ^([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+).(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]


AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff

	
		Header set Access-Control-Allow-Origin "*"
	







	Header unset Etag

FileETag none

	
		AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype image/svg+xml
	


#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

ResponderCitar
Respondido : 04/05/2017 1:45 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

Veo que el código es correcto aunque parece que no te este funcionando, prueba a cambiarlo por el código que te adjunto en el enlace: https://www.pedroventura.com/sysadmin/como-especificar-la-expiracion-de-imagenes-en-la-cache-del-navegador/

ResponderCitar
Respondido : 04/05/2017 4:16 am

Cursos Gratuitos WordPress