Last active
January 26, 2017 18:55
-
-
Save peterwegren/44d02db331f2b2a7821a2344ab116c06 to your computer and use it in GitHub Desktop.
Apache .htaccess browser caching settings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 1 month" | |
ExpiresByType text/html "access 1 month" | |
ExpiresByType application/pdf "access 1 month" | |
ExpiresByType application/javascript "access 1 month" | |
ExpiresByType application/x-javascript "access 1 month" | |
ExpiresByType application/x-shockwave-flash "access 1 month" | |
ExpiresByType image/x-icon "access 1 year" | |
ExpiresDefault "access 1 month" | |
</IfModule> | |
## EXPIRES CACHING ## | |
## Cache-Control ## | |
# One year for image files | |
<filesMatch ".(jpg|jpeg|png|gif|ico)$"> | |
Header set Cache-Control "max-age=31536000, public" | |
</filesMatch> | |
# One month for css and js | |
<filesMatch ".(css|js)$"> | |
Header set Cache-Control "max-age=2628000, public" | |
</filesMatch> | |
## Cache-Control ## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment