Prevent caching of pages in Internet Explorer 8

前端 未结 3 1457
再見小時候
再見小時候 2020-12-17 02:04

On my page in IE8, I have got some text which gets changed through an admin panel. For example: if the page contains the text \'hello world\', after 5 minutes the text could

相关标签:
3条回答
  • 2020-12-17 02:43

    When you request the page by POST method instead of GET, you can be pretty sure it will be never cached. User1419007's answer is also correct.

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

    The best way to disable cache is to use a variable with random unique value in your URLs.

    For example if your page's URL is:

    www.abc.com/hello.php

    make it like:

    www.abc.com/hello.php?randomVar=1SH232X-182N19-1929SK

    You can use the current timestamp as the value of randomVar. This way, the page will not be cached.

    0 讨论(0)
  • 2020-12-17 03:10

    You can force Internet Explorer not to cache your page using the following headers:

    Expires: -1
    Cache-Control: private, max-age=0
    

    ↪ See How to control web page caching, across all browsers?

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