osulyanov
1/25/2014 - 2:15 PM

Apache an nginx configuration for browser cache for static resources

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;
}