简体   繁体   中英

Does ASP.NET Response Cache interacts with ASP.NET HttpRuntime Cache?

Are ASP.NET Response Cache and ASP.NET HttpRuntime.Cache completely different?

Is there any operation on the Response Cache that would affect HttpRuntime.Cache?

Greetz Robert

Not exactly sure about you mean by Response Cache but AFAIK, there is only one cache store per ASP.NET application domain. Output caching also goes to the same cache store (however cache keys would be generated by ASP.NET based on url and cache policy).

Response.Cache is the cache policy object that allows you to query/control ASP.NET output caching problematically.

So to answer your question - Yes, output caching will definitely affect HttpRuntime.Cache . But its unlikely to affect the items that you had set manually because keys chosen by your are very unlikely to conflict with keys generated by ASP.NET runtime.

EDIT

One thing that I have missed to mention is that starting from .NET 4, output cache supports provider model - so you can have your own OutputCacheProvider that can have a different store than runtime cache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM