IE 8 Caching Problem

元气小坏坏 提交于 2019-12-10 15:06:30

问题


One of my javascript sources had an extra comma that was throwing an error in IE8. So I opened up my editor, deleted the comma, and saved. I reloaded IE8, but it was still pulling the old js file. I deleted everything in "Delete Browsing History...", and restarted the browser. It is still pulling the old file. I even set up a log on my server to show whenever the js file was requested. When reloading with IE, the js file is never requested.

I tried doing the same process in Chrome and FF, and it pulled the new file and logged properly on the server.

Is there some other cache that I am failing to clear in IE that would cause this problem?


回答1:


Try CTRL + F5.

And you can use CTRL + SHIFT + DEL to bring up the dialog where you can clear the cache explicitly.

Just so you know, Browsing History has nothing to do with the cache.




回答2:


Ctrl + F5 is your friend; forces a cold-cache reload. If you're worried about your users having the same problems, though, there's a trick you can use to force them to get new versions.

Keep in mind that if it's an external resource, you can throw a query parameter on the src attribute of a script tag to make IE recognize it as a different version. e.g:

<script type="text/javascript" src="lol.js?new=yes"></script>



回答3:


Maybe using in your scripts using jquery this line of code to correct the browsers do caching:

$.ajaxSetup({ cache: false });



来源:https://stackoverflow.com/questions/2916802/ie-8-caching-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!