HttpCachePolicy.AppendCacheExtension Method
Appends the specified text to the Cache-Control HTTP header.
[Visual Basic] Public Sub AppendCacheExtension( _ ByVal extension As String _ ) [C#] public void AppendCacheExtension( string extension ); [C++] public: void AppendCacheExtension( String* extension ); [JScript] public function AppendCacheExtension( extension : String );
Parameters
- extension
- The text to append to the Cache-Control header.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentNullException | extension is a null reference (Nothing in Visual Basic). |
Remarks
If the browser does not recognize cache control directives or extensions, the browser must ignore the unrecognized terms. For more information, see the document RFC 2616: Hypertext Transfer Protocol - HTTP/1.1, available on the World Wide Web Consortium's site at http://www.w3c.org .
Example
In the following example, which illustrates the use of a chche-control extension supported by Internet Explorer, the server is indicating to the browser that the content will not change for one hour (pre-check=3600) and instructs it to retrieve the content directly from the local cache. However, if the content is modified by the server and the page is requested by the user within a fifteen-minute (post-check= 900) to one-hour period, the browser displays the information found in the local cache but also performs a background check and optional fetch of the new content on the server.
[Visual Basic] Response.Cache.AppendCacheExtension("post-check=900,pre-check=3600") [C#] Response.Cache.AppendCacheExtension("post-check=900,pre-check=3600"); [C++] Response->Cache->AppendCacheExtension(S"post-check=900,pre-check=3600"); [JScript] Response.Cache.AppendCacheExtension("post-check=900,pre-check=3600")
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
HttpCachePolicy Class | HttpCachePolicy Members | System.Web Namespace