ASP.NET Database Cache Invalidation

Rob Howard talks about the new database cache features in ASP.NET 2.0.

Currently one of the downsides of caching data is that your cache doesn't know if the data has changed. So you might end up with a ten minute latency to getÂfresh data updates appearing on a web site. The new version of ASP.NET is more data aware :

<%@ outputcache duration="3600" varybyparam="none" sqldependency="MyDatabase:Authors" %>

From the looks of this your ASP.NET application would need SELECT access on the table, which may not be ideal.

In the past I have seen some cool workarounds for this though, one used an extended stored proc to "touch" a text file. The extended proc could be called by a trigger when a table was updated. ASP.NET can watch the specified file and invalidate the cache when the file changes.

Print | posted on Monday, October 27, 2003 6:00 PM

Comments on this post

# re: ASP.NET Database Cache Invalidation

Requesting Gravatar...
Actually, you don't need SELECT access -- only EXECUTE access (we use a SPROC) and that requirement is only for the lookup table not the table your data originates from.
Left by Rob Howard on Oct 31, 2003 12:53 PM

# re: ASP.NET Database Cache Invalidation

Requesting Gravatar...
Then that is WAY cool!

Thanks Rob
Left by Damian on Nov 01, 2003 5:09 AM

# re: ASP.NET Database Cache Invalidation

Requesting Gravatar...
would you mind; please send cache code to me
(how cache all of database in asp.net)
Left by hossein on Mar 14, 2006 12:01 AM
Comments have been closed on this topic.