Intersoft WebGrid Documentation
DataCacheStorage Property
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : DataCacheStorage Property






Specifies where to store the data cache.

Syntax

Visual Basic (Declaration) 
<ISNet.Serialization.BinarySerializableAttribute()>
<DescriptionAttribute("Specifies where to store the data cache.")>
<CategoryAttribute("Data")>
<DefaultValueAttribute()>
Public Property DataCacheStorage As ISNet.WebUI.CacheStorage
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim value As ISNet.WebUI.CacheStorage
 
instance.DataCacheStorage = value
 
value = instance.DataCacheStorage
C# 
[ISNet.Serialization.BinarySerializableAttribute()]
[DescriptionAttribute("Specifies where to store the data cache.")]
[CategoryAttribute("Data")]
[DefaultValueAttribute()]
public ISNet.WebUI.CacheStorage DataCacheStorage {get; set;}
Delphi 
public read-write property DataCacheStorage: ISNet.WebUI.CacheStorage; 
JScript 
ISNet.Serialization.BinarySerializableAttribute()
DescriptionAttribute("Specifies where to store the data cache.")
CategoryAttribute("Data")
DefaultValueAttribute()
public function get,set DataCacheStorage : ISNet.WebUI.CacheStorage
Managed Extensions for C++ 
[ISNet.Serialization.BinarySerializableAttribute()]
[DescriptionAttribute("Specifies where to store the data cache.")]
[CategoryAttribute("Data")]
[DefaultValueAttribute()]
public: __property ISNet.WebUI.CacheStorage get_DataCacheStorage();
public: __property void set_DataCacheStorage( 
   ISNet.WebUI.CacheStorage value
);
C++/CLI 
[ISNet.Serialization.BinarySerializableAttribute()]
[DescriptionAttribute("Specifies where to store the data cache.")]
[CategoryAttribute("Data")]
[DefaultValueAttribute()]
public:
property ISNet.WebUI.CacheStorage DataCacheStorage {
   ISNet.WebUI.CacheStorage get();
   void set (    ISNet.WebUI.CacheStorage value);
}

Remarks

The default value is PageCache. The PageCache data storage implementation is the one implemented in previous version of grid component. This property is only taken affect when AllowAutoDataCaching property is set to True (by default).

The new Session data storage mode enables better datasource persistent mechanism when information is more scoped per user's session. With this mode, datasource's cache will be valid as long as the session hasn't expired.

The default PageCache storage mode is sufficient and effective for most development scenarios. The following describes the behavior of both modes:

PageCache

  • Stored in ASP.NET's built-in Cache object.
  • Expiring in a time period, by default is 15 minutes.
  • Use SetCacheControl() method to control cache's time and priority.
  • Requires implementation of InitializeDataSource event to take affect effectively.
  • Best used for scenarios when all level of data can be retrieved once together.

Session

  • Stored in Session object.
  • Expiring when session is timed out or Session.Abandon() method is called. To longer the cache time, simply increase the Session's timeout value.
  • Doesn't require implementation of InitializeDataSource event. Work perfectly with common databinding method using DataBind() in Page_Load event. However, databinding implementation using InitializeDataSource event is more recommended for centralized and standardization in control's binding mechanism.
  • Best used for scenarios when data is scoped based per user/session and when on demand data retrieval implementation is required for multiple level of childtables.
  • Better performance, the control will only hit the database for first page load and use the cached data for entire session - unlike PageCache which will need to renew the data in a time period.
  • Better scalability, you can implement SqlServer mode for storing the Session's data for larger applications that work in WebFarm or clustering.

The new FileServer storage option allows you to store the data cache to physical hard drive which has much larger space and can be easily extensible and scalable. You can store the data cache in a centralized cache server in a network, or store the cache in a local file path. You can determine the local file path on the CacheServerConnection property.

Some benefits using FileServer cache are:

  • Highly scalable. You can choose a network drive to store the caches which enabl multiple web servers to access the state
  • Decent performance. With more than dozens of high performance hard drives, you can choose a near-memory speed with high random access and sequential read write hard drive to store the caches.
  • Easily extensible. You can easily extend hard drives with larger one when it becomes insufficient. 

For more information you can read Walkthrough: Configure WebGrid to keep data cache in local computer’s hard drive.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.