0
我有IHttp通用处理程序(.ashx)的图像,我已经发送缓存过期时间为7天,但在谷歌网页洞察它说我应该添加缓存验证程序。 以下是我的代码。请给我介绍一些东西。图像缓存验证器的IHttp通用处理程序(.ashx)
public void ProcessRequest(HttpContext context)
{
TimeSpan refresh = TimeSpan.FromDays(7);
context.Response.Cache.SetExpires(DateTime.Now.Add(refresh));
context.Response.Cache.SetMaxAge(refresh);
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.CacheControl = HttpCacheability.Public.ToString();
context.Response.Cache.SetValidUntilExpires(true);
}
感谢