开发者

Where is cached information stored in ASP.NET?

开发者 https://www.devze.com 2023-01-24 17:43 出处:网络
I am developing a website and I want to implement caching to improve its performance. If I use <@ OutputCache Duration=\"20\" VaryByParam=\"None\">

I am developing a website and I want to implement caching to improve its performance.

If I use

<@ OutputCache Duration="20" VaryByParam="None"> 

where will my page be stor开发者_如何学JAVAed? On the client side or on the server? If it's stored on the client side, where is it stored?

Can I cache a master page?


If you don't specify a location, the Output Cache directive will at least store it on the server. It also allows (via headers) intermediate proxies and clients to cache if they choose to.*

It's up to the consuming client to a) choose whether to respect the cache header and b) where to cache. For most browsers it's usually in "Temporary Internet Files" or some equivalent.

*It's more of a "suggestion" that proxies or clients cache, since either way it's ultimately up to them.


You may checkout the documentation. According to it the default value of the cache location is Any which means:

The output cache can be located on the browser client (where the request originated), on a proxy server (or any other server) participating in the request, or on the server where the request was processed. This value corresponds to the HttpCacheability.Public enumeration value

As far as caching the master you cannot put an OutputCache directive to a master page. You could do it programatically by enabling caching in all the content pages.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号