Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 6th, 2007, 07:01 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
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?

  #2 (permalink)  
Old February 7th, 2007, 11:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
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

  #3 (permalink)  
Old February 9th, 2007, 02:50 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much for your help and detailed reply.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.