Limit ASP.NET View State Caching
NCache provides flexibility to limit the number of view states per group and per session and allows locking the view state metadata. To limit View State caching, make the following changes in <ncContentOptimization>
tag:
<ncContentOptimization>
<settings enableViewstateCaching="true"
viewstateThreshold="0"
cacheUriMapping="true"
enableTrace="true"
groupedViewStateWithSessions="true"
maxViewStatesPerSession="5"
enableMetadataLocking="false"
releaseLockInterval="5000">
<cacheSettings cacheName="demoClusteredCache">
<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. Its default value is true. It comes into play if MaxViewStatesPerSession is enabled. |
ReleaseLockInterval |
Defines interval after which lock is released. Its value is in milliseconds. Its default value is 5000ms. It comes into play if MaxViewStatesPerSession is enabled. |
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