Domanda

va bene, sto ancora cercando di ottenere la mia testa intorno alcune delle cose caching e ho attraversato un paio di esempi che ho trovato su Google. Ho aggiunto il seguente codice nel mio file .htaccess:

### activate mod_expires
ExpiresActive On
### Expire .gif's 1 month from when they're accessed
ExpiresByType image/gif "access plus 3 months"
ExpiresByType image/png "access plus 3 months"
ExpiresByType image/jpg "access plus 3 months"
ExpiresByType text/javascript "access plus 3 months"

Utilizzando gli strumenti di audit e Chrome lo strumento YSlow Firebug, sembra che questo è la memorizzazione nella cache alcune delle mie immagini / file, ma non di gran lunga tutti. Ho ancora un elenco di file (.jpg, .js e .css - So che non ho impostato i file CSS per la cache qui) che non sono nella cache. Il messaggio nella revisione Chrome afferma semplicemente The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers:

alcune delle immagini che non sono di caching sono le immagini di sfondo, altri sono parte di una galleria js e stanno essere chiamato tramite il JS -? Potrebbe essere che colpisce perché non memorizzano nella cache

Ci dispiace non posso dare un link al codice -. I siti ancora coperta dal segreto e limitato alla sola vista del client

Grazie in anticipo!

È stato utile?

Soluzione

Sembra che tu hai scritto i tipi MIME sbagliato:

# enable expirations
ExpiresActive On
ExpiresDefault "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/pjpeg "access plus 1 week"
ExpiresByType text/javascript "modification plus 1 week"
ExpiresByType application/javascript "modification plus 1 week"
ExpiresByType text/css "modification plus 1 week"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top