Distributed Cache for ASP.NET Output Caching
This feature is only available in NCache Enterprise edition.
NCache provides an extremely fast and reliable output caching feature for ASP.NET applications running in web farm environment.
ASP.NET’s output caching system caches the different versions of pages’ content
depending on the various parameters like query string parameters and browser
type. In ASP.NET 4.0, an extensibility point has been added that helps
developers use any other caching system of their choice other than ASP.NET’s
cache. NCache’s output cache provider is derived from
CacheProvider to get benefited from ASP.NET 4.0 output caching extensibility.
Since the enterprise level applications are typically hosted in multi-sever web farms, InProc output caching does not provide much benefit as compared to have a distributed OutProc cache. Using this extensibility feature of ASP.NET 4.0, NCache now has its own ASP.NET output caching provider.
Distributed in Nature: NCache Output Cache provider is OutProc as well as distributed in nature.
Availability: Using NCache’s Output Cache provider, content of different ASP.NET pages can be cached on multiple servers instead of caching them in each of the ASP.NET worker process separately. This allows each server in a web farm to share a single distributed cache.
Reliability and Fault Tolerance: Unlike ASP.NET’s output cache, content cached in NCache’s output cache provider is not lost when a worker process crashes or when IIS application pool is recycled.
Scalability: NCache Output Cache provider is not restricted to the memory available on each server as the cache cluster can grow dynamically.
Output Cache with Custom Hooks: NCache output cache provider gives extra control by allowing the users to hook their custom code to modify the cache item’s attributes before it is cached. Since the ASP.NET output caching system does not give any out of the box mechanism to specify cache dependencies, these hooks can be used to add cached items with the dependencies information. These dependencies can be key, file, or database dependencies.
As in most of the enterprise applications, a page or control’s output usually depends on some data in the database. In such applications, the user would want to keep an output of a page or control cached until the data gets changed in the database on which this page’s content depends. Similarly, the user may want to change the expiration time for certain pages at runtime overriding the default expiration given in configuration settings. All this can be achieved by writing a custom hook by implementing
IOutPutCacheHookinterface. These hooks can be implemented, configured and deployed without making any changes to the applications code. All that is required to configure and deploy is to modify the application’s Web.config file.
No Application Code Change: These hooks can be implemented, configured and deployed without making any changes to the application’s code. All that is required to configure and deploy is to modify the application’s Web.config file.
In This Section
ASP.NET Output Cache Provider Overview
Explains how to configure ASP.NET Output Cache in NCache applications.
ASP.NET Output Cache with Custom Hooks
Explains how to use ASP.NET Output Cache with Custom Hooks in your applications.