IE 8 Caching Problem

2019-06-21 20:28发布

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?

3条回答
萌系小妹纸
2楼-- · 2019-06-21 21:03

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.

查看更多
我只想做你的唯一
3楼-- · 2019-06-21 21:09

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

$.ajaxSetup({ cache: false });

查看更多
劫难
4楼-- · 2019-06-21 21:15

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>
查看更多
登录 后发表回答