ASP.NET Micro Caching: Benefits of a One-Second Cache
page 1 of 7
Published: 03 May 2004
Abstract
When I start talking about caching, I imagine that many people immediately stop listening, thinking "my situation requires up-to-the-minute data, so caching isn't an option". Consider the benefits of what I call 'micro caching', in which data is cached for a very small amount of time. In high volume applications, the benefits can be substantial.
by Steven Smith
Feedback
Average Rating: 
Views (Total / Last 10 Days): 39799/ 459

Introduction

I fell in love with caching when I first started playing with it in the early versions of the ASP.NET alphas.  I was aware of caching before that, but I'd never really gone to the effort to seriously implement a cache engine in an ASP app, and with ASP.NET, I didn't have to.  The thing that attracts me to caching is its impact on performance without requirements (usually) for major re-architecture of the system.

In this article, I'm going to discuss what I call Micro Caching, because it involves caching things for very brief periods.  One of the major downsides of caching in general is that by definition the data is not fresh.  How big a problem this is depends on the application and the user's requirements, which is why it is important to determine the user's tolerance for stale data when gathering requirements.  The knee-jerk answer is going to be 'I need live data all the time', but hopefully with the data in this article, you will be able to convince the user/client that perhaps it would be ok if the data were, say, a second or two old, if it meant they could host the application on half as much hardware.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 4 and 6 and type the answer here:

User Comments

Title: Simultaneous requests   
Name: The Chief
Date: 5/18/2006 8:10:20 AM
Comment:
Hi

If it takes 0.5 seconds to load data and render the page and the server receives 20 requests within this time, does asp.net hold off processing the other 19 requests for the same page until it has finished rendering and caching the output from the first of these 20 page requests?

Your results would suggest that this is indeed what is happening but would appreciate confirmation of this.

We use caching on a busy e-commerce site, but there is still a bit of a hit on the server when the site restarts as all the output on each different category page is loaded and cached at the same time. I'm wondering whether the same data is being loaded twice via multiple requests.

Thanks
Title: Caching   
Name: Arpi
Date: 2/9/2006 6:57:03 AM
Comment:
This article explain right.Hence I want to know how can we stop caching of the system
Title: Not So Silly   
Name: Steven Smith
Date: 7/28/2005 8:32:35 AM
Comment:
Not so - consider a news site like CNN.com. With their traffic I'm sure certain articles are read more than 1/second, and I'm willing to bet their articles are stored in a database. The same is true for an eBay auction nearing its end, or a popular Amazon.com book. There are plenty of large scale applications that could theoretically benefit from this technique. That said, you have to test your own application using realistic usage data for your app, then set the cache duration to something that makes sense for you.
Title: Silly   
Name: Cookie Monster
Date: 7/28/2005 3:05:54 AM
Comment:
This is silly. Only in this test would a 1 second cache make this large of a difference. In the real world, users wouldn't be accessing the exact same piece of data so often, so basically every request would end up a cache miss.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 9/7/2008 11:20:00 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search