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)
Available in Sandboxed Solutions: No

protected CacheType CacheType { get; }

Property Value

Type: Microsoft.SharePoint.WebPartPages.CacheType
A CacheType enumeration value.

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.