Controlling Internet Explorer caching of static content
HTTP Headers
Cache-control: post-check=60,pre-check=3600
Post-check means update the content after returning what you’ve got if necessary.
Pre-check means update the cache if necessary before returning the content.
Expires:
Time in minutes from retrieval to expiration. Stored as an expiration time with cached content.
Setting HTTP Headers
Programmatically when constructing a response.
Response.Expires = (int) TimeSpan.FromMinutes(1.0).TotalMinutes;
In HTML. <META HTTP-EQUIV="REFRESH" CONTENT="0;URL=foo.aspx">
In IIS under page, folder, and site properties à HTTP Headers.
Behavior
With an HTTP Expires header value of one, a new page is fetched from the server if the locally cached copy is more than one minute stale.
Note that requesting a refresh in the browser always goes to the server.
Just entering the address again and pressing Go (or typing Enter) will only go to the server if Expires is set and has expired.
The IE cache behavior is the same between “.htm” and “.aspx” content.
With an Expires HTTP header, a new browser process will return a client cached page if it’s not expired.
Without an Expires HTTP header (None), a new browser always fetches a page the first time, even if it is in the cache.
Subsequently, enter will not fetch but refresh will.
In IE, ToolsàInternet Options…àSettings…àView Files… brings up a Windows Explorer view of cached content including expiration datetimes.
Cached IE content is stored here by default: C:\Documents and Settings\{profile_name}\Local Settings\Temporary Internet Files.