How can I cache the master page in ASP.NET?
A:
If you use the @OutputCache directive on the page that uses the master page, then the master page will be cached along with the rest of the page.
cxfx
2009-12-09 05:42:25
But he didn't want to cache the rest of the page. Right?
Faruz
2009-12-09 05:43:53
A:
Unlike user controls, you can't OutputCache a Master page by itself--only as part of a Page.
Also, OutputCaching won't help the performance of a toolbar with lots of images anyway.
The kind of things that would help include image sprites, client-side caching, using a CDN, using multiple domains for static files, etc.
In case it's helpful, I cover those strategies in my book: Ultra-Fast ASP.NET.
RickNZ
2009-12-09 06:41:48
I cover client-side performance issues in Chapter 2 (pages 13 to 70), including optimizing your HTML structure, optimizing network use with multiple subdomains, image sprites, etc. Then I cover caching in Chapter 3 (pages 71 to 126), including caching at all tiers: client, proxies, server kernel (http.sys), IIS, output caching, fragment caching, etc. There's also a section on Master Pages and User Controls in Chapter 6. The whole book is focused around performance tips; I'm sure other chapters will also be useful.
RickNZ
2009-12-18 03:56:30