Skip to content

Instantly share code, notes, and snippets.

@walkergv
Created January 29, 2015 16:56
Show Gist options
  • Save walkergv/0692a24f1ade95e1167b to your computer and use it in GitHub Desktop.
Save walkergv/0692a24f1ade95e1167b to your computer and use it in GitHub Desktop.
Enable caching in .htaccess file. A common Google Page Speed recommendation.
# Begin Cache Control
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment