-
-
Save osulyanov/8617046 to your computer and use it in GitHub Desktop.
Apache an nginx configuration for browser cache for static resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For Apache, use the Location directive into your virtual host(be sure you have included expires and headers modules) | |
<LocationMatch "^/assets/.*$"> | |
Header unset ETag | |
FileETag None | |
ExpiresActive On | |
ExpiresDefault "access plus 30 days" | |
</LocationMatch> | |
For nginx | |
location ~ ^/assets/ { | |
expires 30d; | |
add_header Cache-Control public; | |
add_header ETag ""; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment