OpenTreeOfLife / opentree

Opentree browsing and curation web site. For overarching or cross-repo concerns, please see the 'germinator' repo.
http://tree.opentreeoflife.org/
BSD 2-Clause "Simplified" License
108 stars 26 forks source link

Prevent stale resources (esp. JS + CSS) from being cached across releases #848

Open jimallman opened 8 years ago

jimallman commented 8 years ago

We have occasionally frustrated users (and testers) when they fetch a fresh version of the web apps, but their browser has cached an older/incompatible version of JS or CSS files. Here are some ways to address this:

  1. add a query-string with SHA or timestamp (changes with each deployment)
  2. move caching to a smarter server-side cache
  3. use a "conditional get request" with an If-Modified-Since header
  4. if (1) above defeats all browser caching, munge the path instead (site/v4.3/myScrips.js)
jimallman commented 8 years ago

@jar398 suggests investing etags as the sensible solution here