Su un sito che testa l'ottimizzazione dei siti, mi è spuntata questa voce in rosso:
No "strong" caching headers (Expires, Cache-Control).
che rimanda a questa guida su google > link
qualcuno può spiegarmi come implementarlo?
Su un sito che testa l'ottimizzazione dei siti, mi è spuntata questa voce in rosso:
No "strong" caching headers (Expires, Cache-Control).
che rimanda a questa guida su google > link
qualcuno può spiegarmi come implementarlo?
è più interessante sapere qual è il sito che ti ha dato quell'errore![]()
NON ABBANDONATE CANI O GATTI!!!
Praticamente ti avvisa che alcuni file potrebbero restare di più in cache evitando così lo scaricamento frequente di essi.
Puoi provare creando un file .htaccess e inserendoci allì'interno:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
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 plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 7 days"
</IfModule>
## EXPIRES CACHING ##
Poi lo carichi nella root.
Attenzione che è un file di configurazione, quindi potresti non vederlo con qualche client ftp!
ho provato e sembra funzionare, quell'errore è sparito ma ne spunta un altro
Freshness lifetime (Cache-Control): 604800 sec, 22% of recommended one month.
Hai un sito dinamico e aggiornabile (CMS) ?
Intanto prova così:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
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 plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
si è un sito dinamico
perfetto ora non ci sono più errori di quel tipo, grazie
ok allora fai così
## EXPIRES CACHING ##
<IfModule mod_expires.c>
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 plus 1 month"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
Fammi sapere..
Aggiorna qualche contenuto del sito e rivisualizzalo, in modo da essere sicuri che le pagine non si cachino troppo!