I added an outputcache directive to my asp.net page (asp.net 4.0) as such:
<%@ OutputCache Duration="3600" Location="Client" VaryByParam="None" %>
However, this does not appear to be working. When I check the http header information I see this:
HTTP/1.1 200 OK =>
Cache-Control => no-cache, no-store
Pragma => no-cache
Content-Type => text/html; charset=utf-8
Expires => -1
Server => Microsoft-IIS/7.0
X-AspNet-Version => 4.0.30319
Set-Cookie => ASP.NET_SessionId=0txhgxrykz5atrc3a42lurn1; path=/; HttpOnly
X-Powered-By => ASP.NET
Date => Tue, 15 Nov 2011 20:47:28 GMT
Connection => close
Content-Length => 17428
The above shows that the OutputCache directive was not applied. I even tried this from codebehind:
this.Response.Cache.SetExpires(DateTime.Now.AddHours(1.0));
TimeSpan ds = new TimeSpan(0, 1, 0, 0);
this.Response.Cache.SetMaxAge(ds);
The above code should have the same results as the OutputCache directive, but when I check the http header information, I can see it's still not being applied.
Basically, the purpose here is to make sure that when a user clicks the back button and lands on my page, the page will not be retrieved from the server. I want to avoid getting the browser popup that asks the user to 'resend.' I want the browser to just use the copy of the page it has in it's cache.
Thanks in advace for any help.