ondemand icon indicating copy to clipboard operation
ondemand copied to clipboard

Configure NGINX to handle cache validation for static assets

Open ericfranz opened this issue 6 years ago • 1 comments

We should configure NGINX to auto-handle HTTP cache validation of static assets it serves by adding the Last-Modified based on the modification date of the file and handling cache validation requests e.g. https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Cache_validation.

See https://discourse.osc.edu/t/newby-question-how-to-link-an-external-css-file-to-an-app-in-ondemand/60/2 for a discussion about cache busting concerns.

You would know this is solved if:

  1. your app uses code that is mostly in static assets in public/ directory of the app
  2. your app does not employ any cache busting strategy for these assets
  3. you verify that you can make changes to these files and client browsers will fetch new versions of the files on future requests (also client browsers should be making cache validation requests when navigating to another page)

┆Issue is synchronized with this Asana task by Unito

ericfranz avatar Oct 26 '18 17:10 ericfranz

reviewed, good idea eventually

matt257 avatar May 23 '24 19:05 matt257