Skip to content

Instantly share code, notes, and snippets.

@brandonhimpfen
Last active December 24, 2015 21:29
Show Gist options
  • Save brandonhimpfen/6866142 to your computer and use it in GitHub Desktop.
Save brandonhimpfen/6866142 to your computer and use it in GitHub Desktop.
Set expires which conforms to Google's PageSpeed testing. Add the code to your .htaccess
<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/javascript "access plus 1 month"
ExpiresByType text/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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment