How to disable cache in InternetExplorer 8

前端 未结 10 821
粉色の甜心
粉色の甜心 2020-12-02 17:07

How can I disable cache in IE8 ? We are doing Javascript development and testing it in IE8, but we have to clear the cache every time we make changes to the Javascript files

相关标签:
10条回答
  • 2020-12-02 17:20

    hit "Fn F12" to open developer tools

    click Cache

    choose "Always refresh from server"

    Every time you refresh it should be clearing the cache, but there are also quick access cache clearing from the cache menu or the shortcuts that are active when the dev tools are open.

    *Note- you must leave the dev tools window open, it doesn't have to be up front, but it has to remain open for the cache to remain disabled.

    0 讨论(0)
  • 2020-12-02 17:22

    Ctrl+F5 Should cause a full page refresh including all that cached javascript.

    Occasionally though, you'll still need a cache clear, because even Ctrl+F5 won't work, for reasons beyond comprehension IE can't even get "refresh" right 100% of the time.

    0 讨论(0)
  • 2020-12-02 17:22

    Load you JavaScript this way.

    <html>
    ...
    <script type="text/javascript">
    document.write('<script src="yourscript.js?'+Math.random()+'"></script>');
    </script>
    ...
    </html>
    

    Edit: In case this is not obvious, remove this code as soon you will go into production!

    0 讨论(0)
  • 2020-12-02 17:25

    Maybe a easier way not to have user refresh the browser is just to rename the js files (and css). This is what worked for me... as the server didn't like a random number after the .js file

    0 讨论(0)
  • 2020-12-02 17:27

    Go to Internet Options. On the General tab, under Browsing History click Settings. Select the "Every time I visit the webpage" radio button.

    This doesn't "disable" the cache per se, but it should fix your underlying problem - the JS files should be reloaded every time.

    0 讨论(0)
  • 2020-12-02 17:30

    If your javascript files are served exclusivley from a sub-directory, you could enable immediate content expiration for that directory in IIS. I recently had this problem serving content from a sub-directory and this was the fastest, simplest solution that I found.

    0 讨论(0)
提交回复
热议问题