简体   繁体   中英

Configure IIS to instruct the browser to not cache JavaScript files

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM