1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| #--------------------------------------------------
# Mise en cache des fichiers dans le navigateur
#--------------------------------------------------
# BEGIN Cache-Control Headers - 2592000s = 30 jours
<ifmodule mod_headers.c>
<filesmatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=3, public"
</filesmatch>
<filesmatch "\\.(css)$">
Header set Cache-Control "max-age=3, public"
</filesmatch>
<filesmatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</filesmatch>
<filesmatch "\\.(html|htm)$">
Header set Cache-Control "max-age=3, public"
</filesmatch>
# Disable caching for scripts and other dynamic files
<filesmatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</filesmatch>
</ifmodule>
# END Cache-Control Headers
#--------------------------------------------------
# BEGIN Expire headers
#--------------------------------------------------
<ifmodule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 3 seconds"
ExpiresByType image/jpg "access plus 3 seconds"
ExpiresByType image/jpeg "access plus 3 seconds"
ExpiresByType image/png "access plus 3 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 3 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</ifmodule>
# END Expire headers |
Partager