Leverage browser ca...
Avisos
Vaciar todo

Hosting WordPress 70% dto Dominios promo

Leverage browser caching  

Página 1 / 2
 
Juan Enrique
 Juan Enrique
Reputable Member

Acabo de hacer un nuevo test con gt metrix y me indica que debo solucionar esto
pueden verlo aqui: http://prntscr.com/fyqh8d

Como puedo solucionar este gran inconveniente???

URL del sitio: Contenido solo visible a usuarios registrados

Citar
Respondido : 22/07/2017 3:14 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

Puedes probar a insertar el siguiente código en el fichero .htaccess de tu PrestaShop:

## EXPIRES CACHING ##

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

## EXPIRES CACHING ##
ResponderCitar
Respondido : 22/07/2017 3:38 am

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

Juan Enrique
 Juan Enrique
Reputable Member

gracias!, ahora todo ese codigo lo copio tal como está de ser asi en que ubicacion lo copio despues de y antes de donde dentro del archivo .htaccess, ahora dentro del .htacces tambien hay parte de lo que me acabas de enviar, lo puedes ver aqui: http://prntscr.com/fyqugu. que hacer??? tambien modifico eso??? finalmente he encontrado que pegando esto en la parte inferior del .htacces mejora bastante sin embargo hize eso pero me genero codigo 500 a menos que lo haya copiado en una ubicacion incorrecta dentro del .htaccess, yo lo pegue aqui, miralo: http://prntscr.com/fyqvlp, pero despues de hacer eso me dio error 500

ResponderCitar
Respondido : 22/07/2017 4:03 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

El código que tienes es correcto, no puedes tener el código duplicado.

Puedes probar a colocar el código al principio o al final donde te genere mejor resultado.

ResponderCitar
Respondido : 22/07/2017 4:15 am

Juan Enrique
 Juan Enrique
Reputable Member

no te entiendo bien, al decirme que el codigo que tengo es decir te refieres a este:

Aplicación AddType / x-javascript .js
AddType text / css .css

AddOutputFilterByType DEFLATE texto / css aplicación / x-javascript texto / x-componente texto / html texto / richtext imagen / svg + xml texto / texto plano / xsd texto / xsl texto / xml image / x-icon application / javascript

BrowserMatch ^ Mozilla / 4 gzip-only-text / html
BrowserMatch ^ Mozilla / 4 .0 [678] no-gzip
BrowserMatch bMSIE! No-gzip! Gzip-sólo-texto / html

Encabezado agregar Vary User-Agent env =! Dont-vary

SetOutputFilter DEFLATE

SetEnvIfNoCase Request_URI . (?: rar | zip) $ no-gzip dont-vary
SetEnvIfNoCase Request_URI . (?: gif | jpg | png) $ no-gzip dont-vary
SetEnvIfNoCase Request_URI . (?: Avi | mov | mp4) $ no-gzip dont-vary
SetEnvIfNoCase Request_URI .mp3 $ no-gzip dont-vary

ahora como te digo yo copio este codigo y me genera error 500, te envie url para que lo puedas ver, al parecer lo estoy copiando en un lugar incorrecto.
estaa informacion lo saque de este enlace: https://translate.google.com.pe/translate?hl=es-419&sl=en&u=https://www.prestashop.com/forums/topic/264644-speed-up-your-site-and-compression-with-htaccess-file/&prev=search

2) ahora me haz enviado este codigo:
## EXPIRES CACHING ##

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

## EXPIRES CACHING ##

ese codigo en que parte lo pego dentro del .htacces y con un detalle mas ahi mismo tambien encuentro este codigo

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/font-woff2 "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"

pregunto, el codigo primero que me brindastes lo copio debajo de este ultimo que te acabo de mostrar

ResponderCitar
Respondido : 22/07/2017 4:30 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

Tienes que borrar uno de los dos porque hay duplicación, prueba con el código que te he enviado y te recomiendo que realices un respaldo del fichero.

ResponderCitar
Respondido : 22/07/2017 4:53 am

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

Juan Enrique
 Juan Enrique
Reputable Member

he combinado el codigo que me distes para copiar con el codigo que aparece dentro del .htaccess, en el codigo que me haz enviado solo dice access 1 year en lo que esta dentro del .htacces dice acces plus 1 year y lo que he hecho que al codigo que me haz dado en agregarle el plus, te envio el codigo que lo he juntado, verificalo porfavor y dime si esta correcto para reemplazar este codigo por el que trae consigo ahora dentro del .htacces

## EXPIRES CACHING ##

ExpiresActive On
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/pdf "access plus 1 month"
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/font-woff2 "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"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresDefault "access 1 month"

## EXPIRES CACHING ##

ResponderCitar
Respondido : 22/07/2017 5:23 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

Si veo que está correcto. Es posible que los resultados no sean inmediatos si utilizas el cache en tu web.

ResponderCitar
Respondido : 22/07/2017 6:10 am

Cursos Gratuitos WordPress

Juan Enrique
 Juan Enrique
Reputable Member

acabo de hacer un nuevo test con gt metrix y mira el resultado no hay mejora alguna sigue en 0 %
veele desde aqui http://prntscr.com/fyrv04

como ves sigue indicando que debo especificar la expiración de todas esas url que indica en el resultado del test, que hacer?

ResponderCitar
Respondido : 22/07/2017 6:19 am
Johnny Heredia Montiel
 Johnny Heredia Montiel
Miembro Moderator

Hola,

Puedes eliminar el código que has enviado y colocar el que recomienda el propio GTMetrix: https://gtmetrix.com/leverage-browser-caching.html

Como te comentaba anteriormente, te recomiendo que le des más tiempo en caso de que sea un tema de caché de tu web.

ResponderCitar
Respondido : 22/07/2017 6:28 am

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

Juan Enrique
 Juan Enrique
Reputable Member

que tiempo esperaria con el codigo que se ha puesto que es este
## EXPIRES CACHING ##

ExpiresActive On
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/pdf "access plus 1 month"
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/font-woff2 "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"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresDefault "access 1 month"

## EXPIRES CACHING ##
y ver que el leverage browser caching comienza a mejorar?
tambien con está modificación que se ha hecho tambien mejoraria lo que respecta a Add Expires headers

ResponderCitar
Respondido : 22/07/2017 6:42 am
Juan Enrique
 Juan Enrique
Reputable Member

Al final puse este codigo siguiente:

## EXPIRES CACHING ##

ExpiresActive On
ExpiresDefault A3600

ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/pdf "access plus 1 month"
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/font-woff2 "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"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresDefault "access plus 1 month"

AddType application/x-javascript .js
AddType text/css .css

AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

Header append Vary User-Agent env=!dont-vary

SetOutputFilter DEFLATE

SetEnvIfNoCase Request_URI .(?:rar|zip)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:gif|jpg|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:avi|mov|mp4)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .mp3$ no-gzip dont-vary

## EXPIRES CACHING ##

Sin embargo al hacerle el test por gt metrix o page speed insyght me sigue figurando que debo especificar cache
lo pueden ver aqui: http://prntscr.com/fyxeed
Será que el modulo mod_expire no este activado en el servidor?

ResponderCitar
Respondido : 22/07/2017 7:10 pm

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

Juan Enrique
 Juan Enrique
Reputable Member

tambien estoy usando este codigo que es el siguiente:

## EXPIRES CACHING ##
Header unset Pragma
FileETag None
Header unset ETag

ExpiresActive on
ExpiresDefault "access plus 14 days"
Header set Cache-Control "public"

Header set Cache-Control "max-age=7200, must-revalidate"

AddType application/x-javascript .js
AddType text/css .css

AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

Header append Vary User-Agent env=!dont-vary

SetOutputFilter DEFLATE

SetEnvIfNoCase Request_URI .(?:rar|zip)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:gif|jpg|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:avi|mov|mp4)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .mp3$ no-gzip dont-vary

## EXPIRES CACHING ##

y tampoco logro solucionar el problema, tanto page speed como pigdom tool, gt metrix me siguen indicando que debo especificar cache al navegador, que mas se puede hacer, mande un ticket y saber si esta activado el mod_expire y me indicaron que si, y si esta activado es un hecho que está configurado para el servidor, que solución me pueden dar para resolver este tema????

ResponderCitar
Respondido : 23/07/2017 10:06 am
Luis Mendez Alejo
 Luis Mendez Alejo
Miembro Admin

Hola Juan,

Yo creo que tu .htaccess para PrestaShop debería tener estos módulos para aproximarse mejor a loq ue te indica PageSpeed y otros analizadores de carga de tu web.

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 "*"
	



	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"



	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
	

Y este bloque debería figurar antes de las líneas:

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

Nota: Haz un backup del actual .htaccess antes de aplicar los cambios.

Saludos

ResponderCitar
Respondido : 24/07/2017 4:11 am

Juan Enrique
 Juan Enrique
Reputable Member

gracias por la ayuda!, el nuevo código que tengo ahora es muy similar al que me acabas de enviar, y por fin mejoro no del todo pero si en mas de la mitad, adjunto imagen del antes y después
esto es del antes: http://prntscr.com/fyxeed
esto del despues: http://prntscr.com/fzodkh
el codigo que tengo es el siguiente:
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
AddType application/font-woff2 .woff2

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

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/font-woff2 "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"

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

a diferencia del que tienes es que debajo de AddType font/otf .otf, tengo
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
y el que tienes es
AddType application/x-font-woff .woff
es posible agregar la linea que me haz enviado debajo de las 2 que tengo o creara un conflicto?
En esta parte se ha agregado woff2 como te muestro a continuacion ya que el que me haz enviado no lo tiene:

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

como se ha agregado woff2, tambien he agregado esto
ExpiresByType application/font-woff2 "access plus 1 year"
después de hacer eso ha mejorado, sin embargo como digo no ha sido del todo corregido completamente y me indica que falta corregir lo siguiente
Leverage browser caching for the following cacheable resources:

https://connect.facebook.net/en_US/fbevents.js (20 minutes)
https://connect.facebook.net/signals/config/291175317932429?v=2.7.18 (20 minutes)
https://connect.facebook.net/signals/plugins/identity.js?v=2.7.18 (20 minutes)
https://www.google-analytics.com/plugins/ua/ec.js (1 hour)
https://www.google-analytics.com/analytics.js (2 hours)
de que manera se puede solucionar eso.

ResponderCitar
Respondido : 24/07/2017 7:23 pm
Página 1 / 2