Chapter 12. Caching Issues and Debugging

ONE OF THE MOST IMPORTANT NEW FEATURES that ASP.NET makes available is a fairly extensive caching engine. This removes the need for “home-grown” caching solutions that often contain memory leaks. ASP.NET’s caching capabilities are integrated at the ISAPI level, so they are much better equipped to handle cached resources.

Although caching in ASP.NET is relatively easy to implement, there are a few intricacies and “gotchas” that we’d like to cover. One of the things that might not be so obvious is that, by nature, caching can make debugging your web application particularly troublesome. For instance, if your web application contains a bug that displays the wrong content on a page, that content could end up trapped in cache. At that point, you would be forced to make a change to the underlying ASP.NET page or user control so that it would refresh itself. That’s not a very elegant solution at all. There is a better way to handle this issue, using a validation callback, which we’ll discuss a bit later.

Let’s take a look at a few techniques for how to deal with both output caching and the Caching API.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset