HttpCachePolicy.AppendCacheExtension(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Appends the specified text to the Cache-Control
HTTP header.
public:
void AppendCacheExtension(System::String ^ extension);
public void AppendCacheExtension (string extension);
member this.AppendCacheExtension : string -> unit
Public Sub AppendCacheExtension (extension As String)
Parameters
- extension
- String
The text to append to the Cache-Control
header.
Exceptions
extension
is null
.
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.
Response.Cache.AppendCacheExtension("post-check=900,pre-check=3600");
Response.Cache.AppendCacheExtension("post-check=900,pre-check=3600")
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 Versions and Dependencies.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기