Cache Master Page in ASP.NET

2019-05-11 09:06发布

How can I cache the master page in ASP.NET?

2条回答
姐就是有狂的资本
2楼-- · 2019-05-11 09:54

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.

查看更多
你好瞎i
3楼-- · 2019-05-11 10:05

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.

查看更多
登录 后发表回答