Cache Master Page in ASP.NET

一笑奈何 提交于 2019-12-07 17:20:38

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/1871801/cache-master-page-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!