HomeLearnGeneral ASP.NET VideosHow Do I: Use the ASP.NET Cache Object to Cache Application Information  

[How Do I]: Use the ASP.NET Cache Object to Cache Application Information

Please install Silverlight or click download to watch video locally.

In this video Chris Pels shows how to use the ASP.NET Cache object to store application information. A sample page is created with a simple user interface and code is added that populates the grid with data from an XML disk file. Then the code is revised to cache the data in the application Cache object after it is initially retrieved and read from the cache for subsequent requests. Finally, methods are added to make use of absolute and sliding time based dependency for the cached object.

Presented by Chris Pels

Duration: 22 minutes, 24 seconds

Date: 26 March 2009

Watch    Video   |   Download    Video   |   VB Code    C# Code

Video downloads: WMV  |  Zune  |  iPod  |  PSP  |  MPEG-4  |  3GP

Audio downloads: AAC  |  WMA  |  MPEG-4  |  MPEG-3  |  MPEG-2

Comments : 7

Leave a Comment

BEHPAK : On March 27, 2009 12:07 PM said:

Hi Mr. chris Pels

thank you for your so nice videos & amazing notes

i want ask you to produce a video to implement & Integration of

FCKeditor to an asp.net Project

i think it is a common problem for asp developers

thankyou so much

SGWellens : On March 28, 2009 1:21 AM said:

Minor point: You don't have to "New" a DataSet when retrieving it from the cache...it already exists in the cache.

cleverwisdomforever : On March 28, 2009 8:38 PM said:

That's brilliant job Chris Pels.

benfree : On March 30, 2009 4:38 PM said:

Nice video..But could you please explain what is the difference between Cache and Session objects (other than the extra features of cache like expiration, dependency etc). Is Cache data specific to user or is it the same data served application-wide? If so, all users are going to see the same data in the grid right?

SGWellens : On April 01, 2009 1:25 AM said:

benfree: Cache data is application wide.

uwspstar : On April 01, 2009 1:37 PM said:

Nice job !!! thanks

conficker : On April 14, 2009 7:24 PM said:

There is a race condition in the example code that may let the cache object expire after the check if the object is cached and before the datasource is assigned from the cache.

instead the ordering must be:

Dataset ds = Cache("dataset")

if (ds == null)

ds = getData()

//use ds here

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities