Trellis leverage browser caching

There is some cache control setup at roles/nginx/templates/h5bp/location/expires.conf

# CSS and Javascript
location ~* \.(?:css|js)$ {
  add_header Cache-Control "max-age=31536000";
  access_log off;
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
  access_log off;
  add_header Cache-Control "max-age=2592000";
}

But I’m getting this message from preformance test pages:

leverage browser caching
The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:

https://stage.superbiajuridico.es/app/themes/sj/dist/scripts/main_b51580bb.js
https://stage.superbiajuridico.es/app/themes/sj/dist/styles/main_b51580bb.css
https://stage.superbiajuridico.es/app/uploads/2018/07/myles-tan-84040-unsplash-2000x1333.jpg

Need these files some aditional setup? It seems to have already more than one week of expiration date.

Are you including it though? Example in group_vars/production/main.yml:

h5bp_expires_enabled: true
1 Like

Thank you! Now, all files have good expiration dates but the google maps api. I’m reading about it.