ndalpe
6/30/2015 - 9:10 AM

Apache browser caching

Apache browser caching

## LEVERAGE BROWSER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 week"
ExpiresByType image/jpeg "access 1 week"
ExpiresByType image/gif "access 1 week"
ExpiresByType image/png "access 1 week"
ExpiresByType image/svg+xml "access 1 week"
ExpiresDefault "access 7 days"
</IfModule>

## Fonts caching for a year
<FilesMatch "\.(eot|svg|ttf|woff)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>

## Cache Icon, PDF and Flash movie for a year
<FilesMatch "\.(ico|pdf|flv|swf)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>

## Cache CSS and JS for 1 week
<FilesMatch "\.(xml|txt|css|js)$">
Header set Cache-Control "max-age=604800, proxy-revalidate"
</FilesMatch>

## LEVERAGE BROWSER CACHING ##