Limit ASP.NET View State Caching
NCache provides flexibility to limit the number of ASP.NET 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>
ASP.NET View State Caching Configuration Members
Following are the ASP.NET View State caching 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 ASP.NET View State
Distributed Cache for ASP.NET Output Caching
ASP.NET SignalR Backplane Overview