[200 OK]: A Port80 Software Blog

We're all 200 OK: Web, HTTP and IIS Insights
posts - 203, comments - 416, trackbacks - 99

My Compressed Pages are Stale on IIS

The HcCacheControl metabase setting is a sneaky setting. Here's why: Recently it was discovered that when a Windows server was updated from Windows 2000 to Server 2003 (rather than a fresh install) this HcCacheControl metabase setting was mysteriously assigned a value of "max-age=86400" when HTTP compression was enabled. This caused some weird behavior. It appeared as though enabling compression caused the server to serve stale pages--changes to newly updated pages were not being displayed when requested.

But the source of this problem has nothing to do with compression. In fact, it doesn't even lie inside the server. It's the browser. And it's the broswer just doing its job. With this metabase setting set, IIS was sending compressed pages with a Cache-Control: max-age=86400 header. This was preventing the browser from making a request to the server for a 24 hours. Forcing a ctrl+F5 refresh will get the fresh data. Otherwise it comes from the browser cache.

Done on purpose as part of a site-wide caching policy, this could be a very smart move. Taking control of these cache related headers leads to great performance improvements and saving server resources. Having them changed without your knowing is sure to lead to confusion.

If you recognize weirdness like this, always check your headers. It can save a lot of troubleshooting time.

posted on Monday, November 15, 2004 4:22 PM

Feedback

No comments posted yet.

Post Comment

Title:  
Name:  
Url:  
Comment:  
Verify:
(Enter the word as it appears in the box above.)