Skip to content

Instantly share code, notes, and snippets.

@alexmoise
Created October 16, 2017 20:14
Show Gist options
  • Save alexmoise/717239924ecebe810b910ec77076a10b to your computer and use it in GitHub Desktop.
Save alexmoise/717239924ecebe810b910ec77076a10b to your computer and use it in GitHub Desktop.
Assets expiration headers for use in .htaccess
# Expire headers
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment