Limit ASP.NET View State Caching
NCache provides flexibility to limit the number of View States per group and session and allows locking of the View State metadata. To limit View State Caching, make the following changes in the <ncContentOptimization>
tag:
<ncContentOptimization>
<settings enableViewstateCaching="true"
viewstateThreshold="0"
cacheUriMapping="true"
enableTrace="true"
groupedViewStateWithSessions="true"
maxViewStatesPerSession="5"
enableMetadataLocking="false"
releaseLockInterval="5000">
<cacheSettings cacheName="demoCache">
<expiration type="None" duration="0" >
</cacheSettings>
</settings>
</ncContentOptimization>
Configuration Members
Members | Description |
---|---|
MaxViewStatesPerSession |
To enable this feature, specify any value greater than zero, if zero or lesser value is configured all View State will be cached. If a tag is skipped, all View State will be cached. |
EnableMetadataLocking |
Defines whether internal metadata manipulation is a locking operation or not. It comes into play if MaxViewStatesPerSession is enabled, its default value is True. |
ReleaseLockInterval |
Defines interval in milliseconds after which the lock is released. It comes into play if MaxViewStatesPerSession is enabled, its default value is 5000ms. |
See Also
Configuring and Using NCache Content Optimization
Group View State with Session
Page Level Grouping for View State
Distributed Cache for ASP.NET Output Caching
ASP.NET SignalR Backplane Overview