HttpCachePolicy.AppendCacheExtension Method (System.Web)

Switch View :
ScriptFree
.NET Framework Class Library
HttpCachePolicy.AppendCacheExtension Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Appends the specified text to the Cache-Control HTTP header.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
Syntax

Visual Basic

Public Sub AppendCacheExtension ( _
	extension As String _
)
C#

public void AppendCacheExtension(
	string extension
)
Visual C++

public:
void AppendCacheExtension(
	String^ extension
)
F#

member AppendCacheExtension : 
        extension:string -> unit 

Parameters

extension
Type: System.String
The text to append to the Cache-Control header.
Exceptions

Exception Condition
ArgumentNullException

extension is null.

Remarks

If the browser does not recognize cache control directives or extensions, the browser must ignore the unrecognized terms. For more information, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the World Wide Web Consortium (W3C) Web site.

AppendCacheExtension is introduced in the .NET Framework version 3.5. For more information, see .NET Framework Versions and Dependencies.

Examples

The following code example demonstrates the use of a cache-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");
    


Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
Platforms

Windows 8 Release Preview, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 SP2, Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also

Reference