Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

javascript - window.location.reload,带有清除缓存[重复](window.location.reload with clear cache [duplicate])

This question already has an answer here:

(这个问题在这里已有答案:)

I want to reload a page using JavaScript but I want to clear cache too, so on page refresh the page has latest versions of everything from server.

(我想使用JavaScript重新加载页面,但我也要清除缓存,所以在页面刷新页面上有来自服务器的所有内容的最新版本。)


Other browsers except IE are not getting latest content.

(除IE之外的其他浏览器没有获得最新内容。)

Any solution for IE9?

(IE9的任何解决方案?)

  ask by coure2011 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

reload() is supposed to accept an argument which tells it to do a hard reload, ie, ignoring the cache:

(reload()应该接受一个参数,告诉它进行硬重载,即忽略缓存:)

location.reload(true);

I can't vouch for its reliability, you may want to investigate this further.

(我无法保证其可靠性,您可能希望进一步调查此问题。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...