Gets or sets a Boolean value that determines whether Microsoft SharePoint Foundation sets the HTTP cache headers on the response for an item fetched from SharePoint Foundation.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
By default, SharePoint Foundation disables caching on items such as Web Part pages. By setting this value on a request early enough in relation to ASP.NET processes (in other words, before the HttpApplication.ReleaseRequestState event occurs), you can prevent SharePoint Foundation from setting the cache headers.
In a custom application that is defined through the Windows SharePoint Services 3.0 object model, set UseDefaultCachePolicy to false to prevent SharePoint Foundation from setting the cache policy, and to implement Web controls whose control or page classes, based on user data, set the cache headers and policy for the resulting response stream. To run a custom application in Windows SharePoint Services 3.0 that is defined through the Windows SharePoint Services 2.0 object model, you can add the following line of code to accomplish the same result:
System.Web.HttpContext.Current.Items("DisableSettingBrowserCacheHeaders") = "true"
System.Web.HttpContext.Current.Items["DisableSettingBrowserCacheHeaders"] = "true";