开发者

how can i debug why things keep getting removed from my asp.net-mvc cache

is there anyway to look on a windows web server to see the current size of the asp.net cache and how much room it has left before things keep getting rejected.

I set to cache objects for 48 hours but i keep seeing web pages load slow so someh开发者_运维百科ow things are getting removed from the cache. (i am passing a variable down to the view that indicates whether it got the result set from the cache or not. one I load a page, i would expect that to be True for the next 48 hours but it doesn't seem to be happening.

any suggestions on how i can debug this further to figure out next steps.


ASP.NET will cache to memory by default, you can add caching to disk, but it is much slower and you will need to write or find a provider.

ASP.NET can remove data from the cache for one of these reasons:

  • Because memory on the server is low, a process known as scavenging.
  • Because the item in the cache has expired.
  • Because the item's dependency changes.

To help you manage cached items, ASP.NET can notify your application when items are removed from the cache.

http://msdn.microsoft.com/en-us/library/ms178597.aspx

Where Content is Cached

By default, when you use the [OutputCache] attribute, content is cached in three locations: the web server, any proxy servers, and the web browser. You can control exactly where content is cached by modifying the Location property of the [OutputCache] attribute.

You can set the Location property to any one of the following values:

  • Any
  • Client
  • Downstream
  • Server
  • None
  • ServerAndClient

http://www.asp.net/mvc/tutorials/improving-performance-with-output-caching-cs

More information

http://www.codeproject.com/KB/web-cache/cachemanagementinaspnet.aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜