Summary
In this chapter, we learned how to use caching to trade memory usage for a reduction in the time taken to generate a page.
We first saw how to ask browsers and proxies to cache our pages and how they provide a (limited) free lunch by providing cache memory that's not only free to us, but close to the visitor as well. While discussing proxy caching, we learned about some security issues and saw that proxy caching doesn't mix with query strings and setting cookies.
Then we looked at output caching, where entire pages or parts of pages are cached on the web server. We saw how to cache different versions of each page based on query string parameters, HTTP headers, or even custom variables. Fragment caching and post-cache substitution were discussed as ways to cache part of a page, while the rest is regenerated for each request. We also looked at implementing your own output cache provider, and two more caching features built into IIS 7: IIS 7 output caching (also known as user mode caching...