Visualizzazione dei risultati da 1 a 9 su 9

Discussione: Caching Headers

  1. #1
    Utente di HTML.it L'avatar di Redmile
    Registrato dal
    Nov 2010
    Messaggi
    106

    Caching Headers

    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?

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2007
    Messaggi
    1,611
    è più interessante sapere qual è il sito che ti ha dato quell'errore
    NON ABBANDONATE CANI O GATTI!!!

  3. #3
    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!

  4. #4
    Utente di HTML.it L'avatar di Redmile
    Registrato dal
    Nov 2010
    Messaggi
    106
    ho provato e sembra funzionare, quell'errore è sparito ma ne spunta un altro

    Freshness lifetime (Cache-Control): 604800 sec, 22% of recommended one month.

  5. #5
    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 ##

  6. #6
    Utente di HTML.it L'avatar di Redmile
    Registrato dal
    Nov 2010
    Messaggi
    106
    si è un sito dinamico

    perfetto ora non ci sono più errori di quel tipo, grazie

  7. #7
    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..

  8. #8
    Utente di HTML.it L'avatar di Redmile
    Registrato dal
    Nov 2010
    Messaggi
    106
    anche questa va bene, grazie

  9. #9
    Aggiorna qualche contenuto del sito e rivisualizzalo, in modo da essere sicuri che le pagine non si cachino troppo!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.