How to instruct web browsers NOT to cache pages?

前端 未结 2 1269
逝去的感伤
逝去的感伤 2021-01-01 06:05

I\'ve got a caching problem with the Internet Explorer 6.0 and I want to instruct the browser not to cache the page he\'s requesting.

Further inform

相关标签:
2条回答
  • 2021-01-01 06:13

    This is a fairly well documented googleable problem, and probably duped several times here, but fwiw this is my standard block (C#):

    Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1
    Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1
    Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1
    Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1
    Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1 
    Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1 
    Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1 
    Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.0 
    Response.AppendHeader("Expires", "Wed, 09 Jun 1993 00:00:00 GMT"); // HTTP 1.0
    
    0 讨论(0)
  • 2021-01-01 06:25

    Check what HTTP headers your server is sending, these can over ride what is in the meta section in the HTML.

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