Skip to Content
ASP.NET 4 Unleashed
book

ASP.NET 4 Unleashed

by Stephen Walther, Kevin Hoffman, Nate Dudek
October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Sams
Content preview from ASP.NET 4 Unleashed

Adding Items with a Sliding Expiration Policy

When you specify a sliding expiration policy, items remain in the cache just as long as they continue to be requested within a specified interval of time. For example, if you specify a sliding expiration policy of 5 minutes, the item remains in the Cache just as long as no more than 5 minutes pass without the item being requested.

Using a sliding expiration policy makes sense when you have too many items to add to the cache. A sliding expiration policy keeps the most requested items in memory and the remaining items are dropped from memory automatically.

The page in Listing 29.37 illustrates how you can add a DataSet to the cache with a sliding expiration policy of 5 minutes.

Listing 29.37. ShowSlidingExpiration.aspx ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4.0 in Practice

ASP.NET 4.0 in Practice

Marco De Sanctis, Daniele Bochicchio, Stefano Mostarda

Publisher Resources

ISBN: 9780132565851Purchase book