zoukankan      html  css  js  c++  java
  • 关于模式窗体的缓存问题的解决方案

    from:http://hi.baidu.com/cnhbhg/blog/item/597f861bfb926ad1ad6e75a8.html

    模式窗体,是通过querstring传值的,当编辑某条信息的时候,遇到弹出的模式窗体老是调用缓存的值的问题,最终还是找到了解决方案,现总结如下:
    html:
    在<head></head>之间加上:
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-cache">

    <meta http-equiv="Pragma" content="no-cache">
    ASP:
    <%
    Response.Expires = -1
    Response.ExpiresAbsolute = Now() - 1
    Response.cachecontrol = "no-cache"
    %>

    //asp.net中,在窗体的PAGE_LOAD事件中加上Response.CacheControl = "no-cache";
    如下:
    protected void Page_Load(object sender, EventArgs e)
        {
            Response.CacheControl = "no-cache";
            if (!Page.IsPostBack)
            {
                this.d1.Value = DateTime.Now.ToString();
            }
        }

    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);
  • 相关阅读:
    String源码分析
    solr IK分词器
    solr安装
    hadoop HA集群搭建(亲测)
    dubbo-admin安装
    关于idea中使用lamb表达式报错:ambda expressions are not supported at this language level
    web项目数据存入mysql数据库中文乱码问题
    dom4j解析xml
    js监听键盘提交表单
    Location replace() 方法
  • 原文地址:https://www.cnblogs.com/baishahe/p/1079389.html
Copyright © 2011-2022 走看看