I have IHttp Generic Handler (.ashx) for images and I have sent cache expire time as 7 days but in Google page insight it says I should add cache validator. following is my code. Please refer me something.
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);
}
Thanks