开发者

Prevent javascript from being cached in browser

开发者 https://www.devze.com 2023-04-09 15:19 出处:网络
I\'m currently working on a webapp and the Javascript is revised fairly often. However, the changes don\'t occur until the browser cache is refreshed manually. Is there a way to impleme开发者_如何转开

I'm currently working on a webapp and the Javascript is revised fairly often. However, the changes don't occur until the browser cache is refreshed manually. Is there a way to impleme开发者_如何转开发nt cache-refreshing automatically through code for Chrome? Thanks.


You can put something like ?2352352 at the end of your JS file. So something like

<script src='myfile.js?20457207'></script>

Where the number randomizes, forcing the browser to think it's a different file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号