Can I rely on ETags for cache control

Viewed 2353

Our current deployment uses a home build cache busting approach: We have mapping file that contains hashes of our javascript files (this mapping is created on application startup). The values in this file are then used in our templates to generate a script tag that includes a GET parameter for cache busting i.e <script src="/static/js/somefile?v=adg34d>

I'm currently converting our entire page to use RequireJS and I would like to get rid of these cache busting parameters since they would be difficult to implement. Our HTTP servers are configured to add a correct Last-Modified and ETag header to each asset resource they serve. If I look at the Chrome Web Console I can see that the browser also uses it and gets a correct 304. While I trust Chrome to get this right there are of course other browsers.

The question is: If I only use Last-Modified and ETag headers can rely on the browser to get it right or do I really need a cache-busting parameter?

I only need to support:

  • Opera
  • Firefox
  • Chrome
  • IE >= 8
  • Safari >= 5
1 Answers
Related