O'Reilly logo

Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional, Second Edition by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

24.4. Caching with Dependencies

As time passes, the information in your data source may change. If your code uses caching, you may remain unaware of the changes and continue using out-of-date information from the cache. To help mitigate this problem, ASP.NET supports cache dependencies. Cache dependencies allow you to make a cached item dependent on another resource, so that when that resource changes, the cached item is removed automatically.

ASP.NET includes three types of dependencies:

  • Dependencies on other cached items

  • Dependencies on files or folders

  • Dependencies on a database query

You'll see all these types of dependencies in the following section.

24.4.1. File Dependencies

To use a cache dependency, you need to create a CacheDependency ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required