O'Reilly logo

ASP.NET MVC 2 Cookbook by Richard Kimber, Andrew Siemer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caching your product catalog for faster response times

There are a lot of applications that are built these days with data that doesn't change all that much. A product catalog is usually a good example of that. There may be updates here or there, but not every five minutes. With fairly static data like this, why do we feel the need to make a request from the controller, through a service class of some type, to a repository, which then reaches out to some form of infrastructure such as a database or the filesystem? In cases like these, we can save ourselves a lot of pain by doing that big reach once and then stuffing the results into the cache for a while. With the next request, we can then just fetch the data directly from the cache.

In this recipe, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required