Ctrl + F5 in jquery to clear browser cache

This question already has an answer here:

  • How can I refresh a page with jQuery? 16 answers

  • I think the reload function can take an argument that forces full refresh. ie:

    window.location.reload(true);
    

    Ctrl+F5 basically used to refresh the client objects. Whenever we change anything into client scripts then we usually do ctrl+f5 to get the updates. Obviously, no developer want this. Well there is a fix for that.

    Seperate your js code into external file and use it in your view.Then, you just need to set a version of JS file where you gonna place it (ie in your view)

    <script src="path.js?123123" type="text/javascript"></script>
    

    Suppose, path.js is your external JS file and ?123123 is basically a temporary versioning of the js file. So, the compiler will always treat it as new file by changing the number.

    Hope this helps

    链接地址: http://www.djcxy.com/p/28666.html

    上一篇: 如何刷新我的当前页面

    下一篇: 在jQuery中Ctrl + F5清除浏览器缓存