Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Apache an nginx configuration for browser cache for static resources
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