Chapter 14. Caching in ASP.NET

 

This chapter covers

  • Output caching techniques in ASP.NET Web Forms and ASP.NET MVC
  • Leveraging ASP.NET Cache for storing data
  • Integrating Windows Server AppFabric into your application

In chapter 13, you learned how state management in ASP.NET dramatically eases the process of building applications for a stateless context such as the World Wide Web. Now you’re going to find out that state management is useful in other situations.

When your web application needs to serve a large number of concurrent requests per second, you need to scale. Scalability is the ability of your application to easily handle a growing amount of work, without needing to take drastic measures. If you need to handle more traffic in your web application, scalability means that you won’t need to rewrite (or adapt) your application.

Scalability is an interesting point of debate, and lots of developers have different opinions about it. When you need to deal with scalability, you’ll typically end up adding more hardware and adapting your application to work correctly. You’ll find this task to be difficult to handle if you didn’t design your application in the right way to begin with. By leveraging ASP.NET Cache, you can increase your application’s scalability and serve multiple requests without needing to add more hardware. In ASP.NET applications, you can achieve scalability by adopting a special set of features, which we’ll cover in this chapter.

14.1. Per-application state: Cache

14.2. Using OutputCache

14.3. OutputCache in ASP.NET MVC

14.4. Data caching techniques

14.5. Building custom cache providers

14.6. Summary