Cache viewstate?

ViewState Caching

This is a great idea, but it is implemented for SharePoint. I wonder if there is a solution for regular asp.net pages, which does the same thing, caches viewports.

+6
caching viewstate
source share
2 answers

It is actually quite simple! You just need to override these two methods on your page:

SavePageStateToPersistentMedium() LoadPageStateFromPersistenceMedium() 

In it, you can get the ViewState object tree, serialize it as you want, and save it where you want (session, SQL, etc.), and instead of returning the entire serialized blob to the browser, just return a unique identifier You can use it to search next time.

The idea is painstaking: http://msdn.microsoft.com/en-us/library/ms972976.aspx

+8
source share

This is entirely possible by overriding the two methods below in

 asp.net System.Web.UI.Page: SavePageStateToPersistentMedium() LoadPageStateFromPersistenceMedium() 

In the first method, you need to check if the ViewState exists in the cache and if it is not stored there, in the second method you can get it if it already exists.

You can combine SessionID and folder_name as the key for the viewStateKey cache.

0
source share

All Articles