【发布时间】:2011-04-01 22:29:11
【问题描述】:
这是我的代码:
class HandlerTest : IHttpHandler,System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Response.Write(DateTime.Now.ToString());
context.Response.Cache.SetExpires(context.Timestamp.AddSeconds(10));
context.Response.Cache.SetMaxAge(new TimeSpan(0, 0, 10));
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetLastModified(context.Timestamp);
context.Response.Cache.SetValidUntilExpires(true);
context.Response.Cache.VaryByParams.IgnoreParams = true;
context.Response.End();
}
public bool IsReusable
{
get { return true; }
}
}
它不起作用。谁能告诉我该怎么做?
【问题讨论】:
标签: .net ihttphandler page-caching