我有带有一个JS文件的ASPX页面。在Firefox中没有更新JS文件。我已经清除了firefox的缓存。
以下是尝试过但仍在获取旧JS文件的选项:
Firefox版本: 13.0.1
发布于 2012-11-30 03:55:23
Ctrl +R(硬刷新)和/或向js添加查询字符串,如下所示:
<script src="scripts/myjavascript.js?v=1"></script>有关此技术的更多信息:What does appending "?v=1" to CSS and Javascript URLs in link and script tags do?
发布于 2012-11-30 03:52:18
如果无法清除缓存,可以尝试将查询字符串添加到文件路径。只要每次页面加载时添加的查询字符串发生更改,通过增量或某种随机生成器,文件就无法从缓存中检索。所以:
<script type="text/javascript" src="main.js">变成了
<script type="text/javascript" src="main.js?randomstring">https://stackoverflow.com/questions/13638734
复制相似问题