Thursday, August 9, 2007

Output Caching

Over the last couple years, I've really done a lot more "web-programming" than I've been used to. Dealing with web caching, http headers, stylesheets, javascript - much more web oriented than I used to. Which bring me to output caching.

Output caching seems like an idea that would be really useful, but I haven't deal with it all that much. I'm currently working on some performance optimizations for a client, and I'm looking at using both output caching on a user control and setting the cache control headers.

Pretty good article below on the ins and outs of output caching from a .Net 1.1 point of view.
http://aspnet.4guysfromrolla.com/articles/022802-1.aspx

.net 2.0 really ups the ante though. The substitution bit below is pretty cool.
http://aspnet.4guysfromrolla.com/articles/121306-1.aspx

VaryByControl is also pretty neat, and gets cool pretty quickly (see the last example).
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/caching/fragment.aspx

I think one of the more important ideas that I've seen is that you can do caching at so many levels (expires headers, output caching, data caching, etc) and you really need to keep those things in mind, especially if your system/framework supports those ideas. The CMS I work with right now does a lot of web-based caching, and knows how the HTTP headers work is a pretty crucial part of writing an application for it.

No comments: