WebPart.CacheType property
Determines the type of caching being used by the Web server.
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Protected ReadOnly Property CacheType As CacheType
Get
'Usage
Dim value As CacheType
value = Me.CacheType
protected CacheType CacheType { get; }
Property value
Type: Microsoft.SharePoint.WebPartPages.CacheType
A CacheType enumeration value.
Remarks
If the type of caching for the Web server is set to Database (in the web.config file <WebPartCache Storage="Database" />), and code in a Web Part tries to cache an object that is not marked as Serializable, then the object is not be cached and performance is affected. To optimize your code, use the CacheType property to prevent caching from being used in this case.