.NETGURU
Expiring Cached values due to changes in a db
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcache' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Buckton, Ron A.
I am looking for a way to expire a cache when data in sql server changes
(through the use of a trigger, extended sproc, or ole automation object) I
can write my own OA object to do this but i'm looking for a better (and more
reliable) method.

Ron

Reply to this message...
 
    
G. Andrew Duthie (VIP)
The simplest method I've found to expire cached data when data in a SQL
Server table is modified is to set up a trigger on the table that calls
a job that runs the SQL Web Assistant. I have the Web assistant generate
an HTML page based on the table, then use that HTML page as a file
dependency for the cached item. When data in the SQL Server table is
updated, the trigger calls the job, which updates the HTML file, which
causes the cached item to be purged.

While this technique is very easy to implement, the caveat is that I
have not done load testing on it to determine how reliably it performs
under load. I can imagine it may be possible due to latency between the
trigger firing (and subsequent actions) and the next request for the
page that a client could get stale data when there are an extremely high
volume of user requests. However, since I have not done load testing,
this is just a theory. In any event, the window during which a client
could get stale data would likely be very small.=20

Regardless of any latency, if your application doesn't require a high
level of scalability, this technique may work just fine for you.

hth,

--
G. Andrew Duthie
Graymad Enterprises, Inc.
Click here to reveal e-mail address

[Original message clipped]

Reply to this message...
 
    
Doug Reilly
One option: Have an extended stored proc or similar write to a file, and have the cache expire on changes to that file. This is not great if you have a cluster.

It would be wonderful if SQL Server could within transact SQL expire a cached item. Maybe next version

On Wed, 21 November 2001, "Buckton, Ron A." wrote:

[Original message clipped]

Doug Reilly
AccessMicrosystems.com

Reply to this message...
 
    
Brian Bilbro (VIP)
One way would be to:

1. Set the cache to expire when a file changes.
2. Create a trigger to just *touch* (i.e. update the date/time on the file)
the file when you need the cache to expire.

Not the greatest solution but should work.

--
Brian

[Original message clipped]

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Reply to this message...
 
    
Alex Lowe
Ron,

Check out (http://www.gotdotnet.com/team/rhoward/SQLDependency.zip).

Alex - AspFriends.com Moderation Team

ASP.NET Examples/Tips: http://aspalliance.com/aldotnet

-----Original Message-----
From: Buckton, Ron A. [mailto:Click here to reveal e-mail address]
Sent: Wednesday, November 21, 2001 10:50 AM
To: aspngcache
Subject: [aspngcache] Expiring Cached values due to changes in a db

I am looking for a way to expire a cache when data in sql server changes
(through the use of a trigger, extended sproc, or ole automation object)
I can write my own OA object to do this but i'm looking for a better
(and more
reliable) method.

Ron

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
    
Rob Howard (VIP)
Note, cache invalidation on SQL changes will be a feature in our next
version.

We've actually found some much better and scalable ways to accomplish
this. I'll post a sample in the relatively near future :)

Rob

-----Original Message-----
From: Alex Lowe [mailto:Click here to reveal e-mail address]=20
Sent: Wednesday, November 21, 2001 8:21 AM
To: aspngcache
Subject: [aspngcache] RE: Expiring Cached values due to changes in a db

Ron,

Check out (http://www.gotdotnet.com/team/rhoward/SQLDependency.zip).

Alex - AspFriends.com Moderation Team

ASP.NET Examples/Tips: http://aspalliance.com/aldotnet

-----Original Message-----
From: Buckton, Ron A. [mailto:Click here to reveal e-mail address]=20
Sent: Wednesday, November 21, 2001 10:50 AM
To: aspngcache
Subject: [aspngcache] Expiring Cached values due to changes in a db

I am looking for a way to expire a cache when data in sql server changes
(through the use of a trigger, extended sproc, or ole automation object)
I can write my own OA object to do this but i'm looking for a better
(and more
reliable) method.

Ron

| [aspngcache] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.aspfriends.com/aspfriends/aspngcache.asp =3D JOIN/QUIT

| [aspngcache] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp =3D JOIN/QUIT

Reply to this message...
 
    
Brian C Freeman
I have a simple way that uses the timestamps from SQL to determine if
the cache is up to date.

It makes the pages to 10x quicker and still shows the most current data.

What are you looking for?

Brian

-----Original Message-----
From: Buckton, Ron A. [mailto:Click here to reveal e-mail address]=20
Sent: Wednesday, November 21, 2001 10:50 AM
To: aspngcache
Subject: [aspngcache] Expiring Cached values due to changes in a db

I am looking for a way to expire a cache when data in sql server changes
(through the use of a trigger, extended sproc, or ole automation object)
I
can write my own OA object to do this but i'm looking for a better (and
more
reliable) method.

Ron

| [aspngcache] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp =3D JOIN/QUIT

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification