Andrew Connell

.NET 2.0 feature: Post-Cache Substitution

At times I get a little annoyed with all the talk about Longhorn and .NET 2.0 with both are still in beta, but at any rate…

Via Nikhil Kothari : He talks about a little known cache enhancement in .NET 2.0.

This feature nicely rounds out the caching support offered by the framework. Previously you could output cache whole pages, or fragments of a page. However, you could not implement a dynamic region within a cached page. The best way to think of this scenario is the AdRotator control, which does make use of this new infrastructure. The entire page might be output cached, but a different ad still needs to be displayed on each request to the page. Post-cache substitution enables this with very little logic on your end. Rather than build the functionality into AdRotator, we provided it as a generic service. As an example, using this service, I could output cache my site’s home page, and continue to change the random photo shown in the sidebar on each request.

ยป Post-Cache Substitution

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.