代码之家  ›  专栏  ›  技术社区  ›  Keith Adler

Safari浏览器忽略我的无缓存

  •  5
  • Keith Adler  · 技术社区  · 15 年前

    我无法强制Safari中的页面总是过期。Chrome、IE和Firefox都是优秀的公民,但Safari却很顺利,忽略了以下ASP.NET代码:

    // Expire immediately
    Response.Expires = 0;
    Response.Cache.SetNoStore();
    Response.AppendHeader("Pragma", "no-cache");
    

    有什么建议吗?

    1 回复  |  直到 15 年前
        1
  •  7
  •   Community Mohan Dere    8 年前

    信不信由你,让Safari总是重新加载页面的方法就是在body标签中添加以下内容:

    onunload=""
    

    我发现这里提到了这一点: Is there a cross-browser onload event when clicking the back button?

    推荐文章