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时都可以清空缓存

  • 相关阅读:
    redis 安装和运行
    Django:django-debug-toolbar模块
    Django 的 logging日志文件配置
    Github之利用SSH完成Git与GitHu 的绑定
    4.输出1-100内的所有偶数
    3.输出1-100内的所有奇数
    2.求1-100的所有整数的和
    1.使用while循环输出1.2.3.4.5.6.....8.9.10
    将前台JS数组序列化后提交,后台反序列化对象
    div模拟下拉框
  • 原文地址:https://www.cnblogs.com/roamman/p/1382765.html
Copyright © 2011-2022 走看看