IE 8 Caching Problem

2019-06-21 21:14发布

问题:

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 });