我的天空(I Like the feeling)

导航

不让ie缓存输出

使用js ajax的时候,经常会有数据源变了,可是页面即使刷新了,数据也还在。除非关掉IE再打开才能更新。这是因为IE的缓存输出功能。可通过下面的方法取消IE缓存。(for C#)

        Response.Buffer = true;
        Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
        Response.AddHeader("pragma", "no-cache");
        Response.AddHeader("cache-control", "");
        Response.CacheControl = "no-cache";

posted on 2008-10-31 14:58  TBLANK  阅读(130)  评论(0编辑  收藏  举报