zoukankan      html  css  js  c++  java
  • IE缓存问题

    现象: img src是重新动态生成的图片,但是原来的图片还是在IE缓存中,图片不能改变。但设置“Internet选项-->常规-->Internet临时文件中"设置"-->每次访问此页时检查”,或者“刷新”都可以改变图片的。

    解决:

    禁用客户端缓存  
      HTM网页  
      <META   HTTP-EQUIV="pragma"   CONTENT="no-cache">  
      <META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache,   must-revalidate">  
      <META   HTTP-EQUIV="expires"   CONTENT="Wed,   26   Feb   1997   08:21:57   GMT">  
      ASP网页  
      <%  
          Response.Expires   =   -1  
          Response.ExpiresAbsolute   =   Now()   -   1  
          Response.cachecontrol   =   "no-cache"  
      %>  
      PHP网页  
      header("Expires:   Mon,   26   Jul   1997   05:00:00   GMT");  
      header("Cache-Control:   no-cache,   must-revalidate");  
      header("Pragma:   no-cache");  
      JSP  
              response.setHeader("Pragma","No-Cache");  
              response.setHeader("Cache-Control","No-Cache");  
              response.setDateHeader("Expires",   0);  
      C#中禁止cache的方法!  
      Response.Buffer=true;  
      Response.ExpiresAbsolute=System.DateTime.Now.AddSeconds(-1);  
      Response.Expires=0;  
      Response.CacheControl="no-cache";  

    或者

    在<%@   Page   language="c#"   Codebehind="A.aspx.cs"   AutoEventWireup="false"   Inherits="*.*"   %>下面加上以下的代码:  
      <%@   OutPutCache   Location="None"%>    能每次页面Load时都可以清空缓存

  • 相关阅读:
    编译安装httpd
    ANSIBLE安装和常用模块模块使用详细教程
    MySQL集群高可用
    MySQL数据库备份和恢复
    MySQL数据库多表查询
    MySQL语句使用。
    MySQL多实例安装教程
    二进制安装MySQL数据库
    半自动化系统安装
    c语言分别用库函数和系统函数来进行文件操作效率对比
  • 原文地址:https://www.cnblogs.com/roamman/p/1382765.html
Copyright © 2011-2022 走看看