IIS 5 & IIS 6
IIS6 caching problem on new server
Last post Oct 21, 2008 03:17 PM by robbieh
Oct 03, 2008 08:58 AM|robbieh|LINK
When I deploy a new Asp.Net 2.0 site from our local dev/test servers to a new server, all of which are running Windows 2003 SP2 and IIS 6.0, I have a problem with pages not refreshing on the new site as they do on the local servers and also on the existing
Basically each time a page is accessed they are served a stale version of the page, no matter which computer/browser is used to view the page.
We have observed that the following methods successfully cause page refreshes: -
1) Ctrl-F5 is pressed in the browser, which bypasses browser AND IIS caching.
2) The requested page and query string have not been viewed for exactly 30 seconds.
3) Asp.Net tracing is enabled with page output [which would cause .Net to turn off IIS caching for each page when trace info is appended to the end of the page.]
Asp.Net 2.0 Output caching is not currently enabled/used for any Web Pages.
To rule out any proxy caching, which we thought would not be fixed by (3) above, we accessed the site from a computer with a direct connection.
Consequently we concluded it must be caused by IIS6 caching and we have tried -
1) enabling “immediate cache expiration” in IIS Manager
2) checked an XML export of our local IIS6 settings against those of the beta settings and could find no differences that would affect IIS caching.
3) disabling every IIS6/HTTP.sys cache setting we can find in the registry and restarting IIS but the problem still remains.
Unfortunately none of this solved the problem. I would appreciate it greatly if anyone could share some insight or possible solutions to this issue.
Thanks in advance.
Oct 20, 2008 02:48 PM|Shred81|LINK
Dude, I am having the self same problem. And its driving me mad. I tried the application on a few other servers and the same application works 100%. It had something to do with the IIS.
Let me know if you come right. And I will let you know as well.
Oct 20, 2008 03:47 PM|Shred81|LINK
One thing that I noticed is that this behaviour does not happen if I run the application from the server itself.
Oct 21, 2008 03:17 PM|robbieh|LINK
After trying various combinations of the following: -
Response.CacheControl = "no-cache";
Response.Expires = -1;
Response.ExpiresAbsolute = new DateTime(1900, 1, 1);
I finally discover that the following did the trick: -
<META Http-Equiv="Cache-Control" Content="no-store">
[-presume this is the same as Response.CacheControl = "no-cache"]
<META Http-Equiv="Cache-Control" Content="no-cache">
3) Response.Expires = -1;
Using (1) and (2) together doesn't make that much sense to me, but (2) on its own didn't work!
Despite fixing the problem I am still interested to know why this combination was necessary.