Geeks With Blogs
Eron Wright - All Killer No Filler blog

Rob Howard presented the expanded support for caching in ASP.NET.  Two main features were presented:

CacheDependency is now extensible.  By overriding a small set of virtual methods, you can implement any cache dependency scheme.  For example you can call a web service to check the validity of some data.  You can use your custom CacheDependency instance to control output caching of a page:

Dim myDependency As New MyCacheDependency(...)
Response.AddCacheDependency(myDependency)

The other main feature is that Whidbey will support database cache dependencies.   There is a separate implementation for Sql Server 7/2000 and for Yukon.

  • Sql Server 7 & 2000 will support table-level dependency tracking.  That is, for a given query, you declare the set of tables to watch.  If data is changed in any of those tables, the cache entry will expire.  Obviously, this is extremely pessimistic and thus is only suitable for tables that change infrequently.  Also, a light-weight polling mechanism is used:  when data changes, a trigger writes to a table with one row per table that is being watched.   On a configurable interval, ASP.NET will poll the table and invalidate entries appropriately.
  • Yukon will support row-level dependency tracking.  It works in roughly the same way as indexed views.   Think about it - when a table changes, the corresponding indexed views are updated.  The same analysis that provides that functionality also provides the cache invalidation feature.  The consequence is that the query in question is subject to the same constraints as indexed views.  If a query is not supported, an invalidation notification is fired immediately.  Exciting!  Note that the client-side plumbing is handled by ADO.NET.

Database-driven cache invalidation is a real gift to the world!. 

See my post, http://geekswithblogs.net/ewright/posts/309.aspx, for information on achieving table-level invalidation in ASP.NET 1.0!

Posted on Tuesday, October 28, 2003 6:55 PM Technology , PDC | Back to top


Comments on this post: PDC: Advanced ASP.NET Caching for 2.0

# re: PDC: Advanced ASP.NET Caching for 2.0
Requesting Gravatar...
CacheDependency is now extensible. By overriding a small set of virtual methods, you can implement any cache dependency scheme. For example you can call a web service to check the validity of some data. You can use your custom CacheDependency instance to control output caching of a page:

Left by fghfghf on Jan 12, 2005 4:02 AM

Your comment:
 (will show your gravatar)


Copyright © Eron Wright | Powered by: GeeksWithBlogs.net