Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2007, 07:01 PM
Authorized User
 
Join Date: Mar 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Caching

I have been reading about caching in the book, page 69. I understand that Marco did not use SQL dependency for the reasons explained in the book. Reading the paragraph entitled, "Choosing a Caching Strategy That Fits Your Needs", Marco says "To avoid displaying stale data, we'll implement some simple methods that purge data from cache when it actually changes in the database" - Where is this actually done in the code?

 
Old February 7th, 2007, 11:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could search for "dependency" in the source code, but I don't remember seeing it. It's pretty easy to set up if you want it, but it's not real friendly to shared hosting. If you have a hosting company that understands SQL 2005 they wouldn't mind you using it, because its really not a heavy load on the DB. But with SQL 2000 it's more invasive because they have to poll the DB.

I don't see many areas where it would help. If you set a cache lifetime of only 3 seconds, for example, that's going to give you new data every 3 seconds. It's only in rare cases where you truly need an immediate cache invalidation. And if it's your own code that updates the underlying data, then you can invalidate your own cache at the same time you update that data.

Even a small 3 second cache will dramatically improve scalability for a heavily used site. The longer your cache stays alive, the less incremental benefit you get from it, anyway.

However, you can crank up the cache lifetime if you don't mind having stale data. For something like Articles, it's a fair bet that a 1 minute cache isn't going to be a problem (or even 10 minutes). But I'd like a shorter cache lifetime for the forums.

Eric

 
Old February 9th, 2007, 02:50 PM
Authorized User
 
Join Date: Mar 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much for your help and detailed reply.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Caching stu9820 ASP.NET 3.5 Basics 0 June 20th, 2008 03:20 PM
caching jezywrap ASP.NET 2.0 Professional 0 February 27th, 2007 05:00 PM
caching? freaknfreak HTML Code Clinic 1 January 24th, 2006 12:10 PM
Caching bmains ASP.NET 1.x and 2.0 Application Design 4 February 27th, 2004 09:06 AM
.NEt Caching Mahavishnu VS.NET 2002/2003 0 February 17th, 2004 08:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.