Last active
July 2, 2019 20:35
-
-
Save iconifyit/535d4e29734ac7c8e9724142475b2dfd to your computer and use it in GitHub Desktop.
Typical Expires, Etag, and Cache-control for Google Site Speed Test best results
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 plus 1 month" | |
ExpiresByType image/jpeg "access plus 1 month" | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" | |
ExpiresByType text/css "access plus 1 month" | |
ExpiresByType application/pdf "access plus 1 month" | |
ExpiresByType text/x-javascript "access plus 1 month" | |
ExpiresByType application/x-shockwave-flash "access plus 1 month" | |
ExpiresByType image/x-icon "access plus 1 year" | |
ExpiresDefault "access plus 2 days" | |
</IfModule> | |
## EXPIRES CACHING ## | |
## Etags | |
Header unset ETag | |
FileETag None | |
## Etags | |
## CSS caching | |
<filesMatch ".(css)$"> | |
Header set Cache-Control "max-age=31536000, public" | |
</filesMatch> | |
## JS caching | |
<filesMatch ".(js)$"> | |
Header set Cache-Control "max-age=2628000, private" | |
</filesMatch> | |
## Image caching | |
<filesMatch ".(jpg|jpeg|png|gif|ico)$"> | |
Header set Cache-Control "max-age=86400, public" | |
</filesMatch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment