Skip to content

Instantly share code, notes, and snippets.

@Kaapiii
Last active December 16, 2015 11:09
Show Gist options
  • Save Kaapiii/5425630 to your computer and use it in GitHub Desktop.
Save Kaapiii/5425630 to your computer and use it in GitHub Desktop.
Enable bowser caching with htaccess
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/gif "access plus 6 months"
ExpiresByType image/jpeg "access plus 6 months"
ExpiresByType image/png "access plus 6 months"
ExpiresByType image/x-icon "access 1 year"
# Media
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType application/rss+xml "access plus 1 hour"
# html / css / js
ExpiresByType text/css "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"
ExpiresByType application/javascript "access plus 6 months"
# webfonts
ExpiresByType font/ttf "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment