Skip to content

Instantly share code, notes, and snippets.

@ryanburgess
Created December 23, 2013 14:17
Show Gist options
  • Select an option

  • Save ryanburgess/8097778 to your computer and use it in GitHub Desktop.

Select an option

Save ryanburgess/8097778 to your computer and use it in GitHub Desktop.
Enable browser caching in .htaccess
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
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 ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment