Data Caching Example, How Data Caching work in ASP.Net

Caching of data can dramatically improve the performance of an application by reducing database contention and round-trips. Simply data caching store the required data in cache so that web server did not send request to DB server every time for each and every request which increase the web site performance. For data caching we need to cached those data which is accessible to all or which is very common data. The data cache is a full-featured cache engine that enables you to store and retrieve data between multiple HTTP requests and multiple sessions within the same application .
how we can implement data caching in our web application. There are Three Different way to add data or object into cache. But based upon the situation we have to access it. These methods are Cache[], Cache.add(), cache.insert(). The following table will show you the clear difference of there methods.

As we are getting, cache[] is property that is very simple to use but cache.insert() and cache.add() are having some more property which give us more control on cached data.
Now we should look into details of Cache.Insert() and Cache.Add() methods. Cache.Insert() having 4 overloaded method where as Cache.Add() having no overloaded methods. Following table are showing are most commonly used important property for those methods.

Tags: , , , , , , , , , , , , , ,
Hot on Web:


About author