I Need To Set Expiry Headers In my Asp.net code.. Is there any way through which I Can Add expiry Headers through code.?
I Have tried adding the following code in my asp page
<% System.Web.HttpContext.Current.Response.AddHeader( "Cache-Control","no-cache");
System.Web.HttpContext.Current.Response.Expires = 0;
System.Web.HttpContext.Current.Response.Cache.SetNoStore();
System.Web.HttpContext.Current.Response.AddHeader("Pragma", "no-cache");%>
<%@ OutputCache Duration="86400" Location="Client" VaryByParam="None" %>
and added the following in my c# page...
Response.AddHeader("Expires", "Thu, 01 Dec 2014 16:00:00 GMT");
AND
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetMaxAge(TimeSpan.FromSeconds(3600));
Response.Cache.SetExpires(DateTime.UtcNow.AddSeconds(3600));
and added this to web,config file
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />