Back to top

Autore Topic: Add Expires headers  (Letto 1881 volte)

Offline fabioweb

  • Appassionato
  • ***
  • Post: 443
    • Mostra profilo
Add Expires headers
« il: 18 Mag 2015, 16:45:09 »
Buonasera forum,
per meglio ottimizzare il sito web ho inserito nell'htaccess la seguente direttiva come specificato nella documentation ufficiale

Codice: [Seleziona]
<IfModule mod_expires.c>
# Enable expiration control
ExpiresActive On
 
# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 hour"
 
# CSS and JS expiration: 1 week after request
ExpiresByType text/css "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"
 
# Image files expiration: 1 month after request
ExpiresByType image/bmp "now plus 1 month"
ExpiresByType image/gif "now plus 1 month"
ExpiresByType image/jpeg "now plus 1 month"
ExpiresByType image/jp2 "now plus 1 month"
ExpiresByType image/pipeg "now plus 1 month"
ExpiresByType image/png "now plus 1 month"
ExpiresByType image/svg+xml "now plus 1 month"
ExpiresByType image/tiff "now plus 1 month"
ExpiresByType image/vnd.microsoft.icon "now plus 1 month"
ExpiresByType image/x-icon "now plus 1 month"
ExpiresByType image/ico "now plus 1 month"
ExpiresByType image/icon "now plus 1 month"
ExpiresByType text/ico "now plus 1 month"
ExpiresByType application/ico "now plus 1 month"
ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
ExpiresByType application/vnd.wap.wbxml "now plus 1 month"
ExpiresByType application/smil "now plus 1 month"
 
# Audio files expiration: 1 month after request
ExpiresByType audio/basic "now plus 1 month"
ExpiresByType audio/mid "now plus 1 month"
ExpiresByType audio/midi "now plus 1 month"
ExpiresByType audio/mpeg "now plus 1 month"
ExpiresByType audio/x-aiff "now plus 1 month"
ExpiresByType audio/x-mpegurl "now plus 1 month"
ExpiresByType audio/x-pn-realaudio "now plus 1 month"
ExpiresByType audio/x-wav "now plus 1 month"
 
# Movie files expiration: 1 month after request
ExpiresByType application/x-shockwave-flash "now plus 1 month"
ExpiresByType x-world/x-vrml "now plus 1 month"
ExpiresByType video/x-msvideo "now plus 1 month"
ExpiresByType video/mpeg "now plus 1 month"
ExpiresByType video/mp4 "now plus 1 month"
ExpiresByType video/quicktime "now plus 1 month"
ExpiresByType video/x-la-asf "now plus 1 month"
ExpiresByType video/x-ms-asf "now plus 1 month"
</IfModule>
########## End - Optimal expiration time

Il server supporta la direttiva mod_expires.c però è come se non venisse applicata ossia il parametro Add Expires headers viene classificato a livello F..

Come mai?
Grazie mille

Offline suondarden

  • Esploratore
  • **
  • Post: 56
    • Mostra profilo
Re:Add Expires headers
« Risposta #1 il: 26 Mag 2015, 10:34:24 »
Ciao aspettando che qualcuno più competente di me ti risponda io ho risolto inserendo all'interno di .htaccess questo codice, fammi sapere se va :)
ciao!


Codice: [Seleziona]
ExpiresActive on
ExpiresByType image/jpg "access 2 month"
ExpiresByType image/gif "access 2 month"
ExpiresByType image/jpg "access 2 month"
ExpiresByType image/jpeg "access 2 month"
ExpiresByType image/png "access 2 month"
ExpiresByType text/css "access 2 month"
ExpiresByType application/x-javascript "access plus 2 month"
ExpiresByType text/javascript "access plus 2 month"
ExpiresByType application/javascript "access plus 2 month"
ExpiresByType image/x-icon "access plus 12 month"
ExpiresByType image/icon "access plus 12 month"
ExpiresByType application/x-ico "access plus 12 month"
ExpiresByType application/ico "access plus 12 month"
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
« Ultima modifica: 26 Mag 2015, 10:36:46 da suondarden »

Offline fabioweb

  • Appassionato
  • ***
  • Post: 443
    • Mostra profilo
Re:Add Expires headers
« Risposta #2 il: 26 Mag 2015, 22:50:49 »
Grazie per il tuo riscontro,
Internal error server 500 =(

 



Web Design Bolzano Kreatif