<configuration>
  <location path="WebForm1.asp">
    <system.webServer>
      <caching>
        <profiles>
          <remove extension=".asp" />
          <add extension=".asp" policy="DontCache" kernelCachePolicy="DontCache"/>
        </profiles>
      </caching>
    </system.webServer>
  </location>
</configuration>在web.config中如此配置还是能缓存页面 求教有没有别的方法.
要求必须在web.config中进行配置的 不缓存页面和其中的SWF格式的文件.
求教!配置一个局部页面不缓存

解决方案 »

  1.   


            /// <summary>
            /// 清除客户端缓存
            /// </summary>
            public static void ClearClientCache()
            {
                System.Web.HttpContext.Current.Response.Buffer = true;
                System.Web.HttpContext.Current.Response.Expires = 0;
                System.Web.HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
                System.Web.HttpContext.Current.Response.AddHeader("pragma", "no-cache");
                System.Web.HttpContext.Current.Response.AddHeader("cache-control", "private");
                System.Web.HttpContext.Current.Response.CacheControl = "no-cache";
            }你是想要这个吧
      

  2.   

    我想在一个程序创建一个子文件夹 里面有单独的显示页面 给这个子文件 单独设置WEB.CONFIG文件来进行控制这个页面不缓存 上面的办法无法解决火狐浏览器中about:cache的缓存控制 有没有在WEB.CONFIG文件中进行控制的方法? 我只要求不缓存SWF格式的文件就可以!