Question about Trellis + caching. 'Leverage browser caching' Google PageSpeed

Here’s what we use on roots.io:

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
  expires 1M;
  access_log off;
  add_header Cache-Control "public";
  gzip_vary on;
}

# CSS and Javascript
location ~* \.(?:css|js)$ {
  expires 1y;
  access_log off;
  add_header Cache-Control "immutable";
  add_header Cache-Control "public";
  gzip_vary on;
}
17 Likes