ComponentOne WebData for ASP.NET:Using WebDataObjects for ASP.NET Components > Cache Storage

Cache Storage

Cache storage mode can be specified in CacheProperties (for global cache) and in SessionCacheProperties (for session cache, default that can be overridden in session cache method calls). It is one of the two options in the CacheStorageModeEnum enumeration: Memory or File.

Cached data can be stored in memory (option: Memory). This option provides slightly better performance, but takes up server memory resources. It is less a concern with the global cache because the global cache holds only limited number of cached data set instances (see the MaxCount property). With the session cache, Memory is a less frequently used option because session cache instances remain alive as long as the user session is alive, so using the session cache for large data sets (not counting memory-resident table views) with large number of users can use up server memory.

The default option for the global cache is File. File storage is available for the session cache as well. In this case data is stored in binary files on the server, a file per data set instance, in a directory that can be specified in cache tuning properties.

The default option for session cache is Memory. In this case the whole data set object is stored in memory in ready filled state, so it is immediately reused on postbacks, does not need to be filled with data at all. Performance gain can be dramatic, since there is virtually no delay for data retrieval. However, Memory storage mode consumes server memory. Also, the immediate, without copying data, storage and retrieval in Memory mode take effect only if you configure your application for in-process mode (use SessionStateMode = InProc). In other session state modes, SqlServer and StateServer, the data is first copied to a persistent object in memory, which is also fast, but depends on the data size.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.