0

Is there a simple way to configure IIS 7 to mark any JavaScript files it serves as uncacheable so that the client browser will not cache them? I'm building an app that makes extensive use of JavaScript and Chrome's lack of a hard refresh and non-deterministic behavior is driving me nuts.

joelc
  • 2,171
  • 4
  • 29
  • 52
  • Any server configuration would depend on a proper implementation by the browser. Having said that, Chrome has a "Disable cache" option in the developer tools which can't be restricted only to JavaScript but could be useful to you. (http://stackoverflow.com/q/5690269/422353) – madth3 Feb 20 '12 at 20:39
  • I need to do this on the server side. – joelc Feb 20 '12 at 20:42

1 Answers1

1

The most bulletproof solution would be to use a timestamp or some kind of a hash etc as a part of the JS filename, so that every time the browser would think it's requesting a brand new file.

Caching Tutorial is a great (and very thorough) article on controlling caching.

zatatatata
  • 4,491
  • 1
  • 17
  • 39