Skip to content

Instantly share code, notes, and snippets.

@Kaapiii
Last active December 16, 2015 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaapiii/5460488 to your computer and use it in GitHub Desktop.
Save Kaapiii/5460488 to your computer and use it in GitHub Desktop.
.htaccss performance boost
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 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 14 days"
ExpiresByType text/javascript "access plus 14 days"
ExpiresByType application/javascript "access plus 14 days"
# 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 1 week"
</IfModule>
## EXPIRES CACHING ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment