System.Web.HttpCachePolicy.SetAllowResponseInBrowserHistory Method

Makes the response is available in the client browser History cache, regardless of the System.Web.HttpCacheability setting made on the server, when the allow parameter is true.

Syntax

public void SetAllowResponseInBrowserHistory (bool allow)

Parameters

allow
true to direct the client browser to store responses in the History folder; otherwise false. The default is false.

Remarks

When System.Web.HttpCacheability is set to HttpCacheability.NoCache or HttpCacheability.ServerAndNoCache the Expires HTTP header is by default set to -1; this tells the client not to cache responses in the History folder, so that when you use the back/forward buttons the client requests a new version of the response each time. You can override this behavior by calling the HttpCachePolicy.SetAllowResponseInBrowserHistory(bool) method with the allow parameter set to true.

If System.Web.HttpCacheability is set to values other than HttpCacheability.NoCache or HttpCacheability.ServerAndNoCache, calling the HttpCachePolicy.SetAllowResponseInBrowserHistory(bool) method with either value for allow has no effect.

HttpCachePolicy.SetAllowResponseInBrowserHistory(bool) is introduced in the .NET Framework version 3.5. For more information, see The .NET Framework 3.5 Architecture.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0