Article ID: 247404 - View products that this article applies to.
This article was previously published under Q247404
Web administrators who use Internet Information Services (IIS) may need to periodically disable the caching of content that changes frequently. This article describes how to set the value of the Cache-Control HTTP Header by using Active Server Pages (ASP), as well as the metabase property CacheControlCustom.
When you work with content that often changes, you may want to specify what content can be cached and what cannot, and if the client or a proxy server should cache the content. You can specify these options in IIS through the CacheControlCustom property, which can be set for the entire server, a particular Web site, or a specific physical or virtual directory. Setting this property returns HTTP headers that resemble the following:
The cache setting value is determined by the HTTP/1.1 specification.
Commonly-Used HTTP/1.1 Cache-Control Header ValuesThe HTTP/1.1 specification in RFC 2616 defines several values for the Cache-Control header. The following list contains a few of the more common values that are used.
Setting the Cache-Control PropertyThe following examples define different methods for setting this value:
For a PageUsing Active Server Pages (ASP), the following ASP code disables caching of a particular page:
NOTE: This code must be inserted at the beginning of the page, unless buffering is enabled, because it is modifying the HTTP headers.
For a FolderThe following examples set the Cache-Control setting for a folder or virtual directory named "Images" in the default Web site:
REFERENCESFor more information on this topic, please see the following Microsoft Knowledge Base article:
247389In addition, see section 14.9 of the HTTP/1.1 specification in RFC 2616 at the following URL:
(http://support.microsoft.com/kb/247389/EN-US/ )IIS: How to Disable Caching of Specific MIME Types
(http://www.w3.org/Protocols/rfc2616/rfc2616.html)Hypertext Transfer Protocol -- HTTP/1.1
Article ID: 247404 - Last Review: December 3, 2007 - Revision: 2.6
Contact us for more help