httpruntime.cache

50GB HttpRuntime.Cache Persistence Possible?

烂漫一生 提交于 2019-12-03 10:04:19
We have an ASP.NET 4.0 application that draws from a database a complex data structure that takes over 12 hours to push into an in memory data structure (that is later stored in HttpRuntime.Cache). The size of the data structure is quickly increasing and we can't continue waiting 12+ hours to get it into memory if the application restarts. This is a major issue if you want to change the web.config or any code in the web application that causes a restart - it means a long wait before the application can be used, and hinders development or updating the deployment. The data structure MUST be in

What's the difference between the HttpRuntime Cache and the HttpContext Cache?

你离开我真会死。 提交于 2019-12-02 18:15:40
I know there is a very similar question here but I was hoping to get a better explination. Why would I ever use HttpContext.Cache instead of HttpRuntime.Cache if the HttpContext really uses the HttpRuntime.Cache behind the scenes? In the article Simulate a Windows Service using ASP.NET to run scheduled jobs Omar uses the HttpContext to store his cache items, but when Jeff Atwood Implemented it here he chose to use the HttpRuntime instead. Obviously in this particular situation it makes sense since since you don't have to do a web request to add the cache item back into the HttpContext. However

Read HttpRuntime.Cache item as read-only

≯℡__Kan透↙ 提交于 2019-12-01 04:05:18
I am using a HttpRuntime.Cache to store a list of objects that will be accessing frequently across sessions. I use the following line of code to get the item from the cache: List<chartData_Type> _chartData = (List<chartData_Type>)HttpRuntime.Cache.Get("rollingMonth"); But, unfortunately when I update the _chartData , it updates the cached item too. How can I simply get a copy of the cached item? That is the way which .NET works because Cache just reference to the pointer of List . Don't know whether you chartData_Type is value type or reference type. If value type, it is easy to use: List

Read HttpRuntime.Cache item as read-only

試著忘記壹切 提交于 2019-12-01 01:11:47
问题 I am using a HttpRuntime.Cache to store a list of objects that will be accessing frequently across sessions. I use the following line of code to get the item from the cache: List<chartData_Type> _chartData = (List<chartData_Type>)HttpRuntime.Cache.Get("rollingMonth"); But, unfortunately when I update the _chartData , it updates the cached item too. How can I simply get a copy of the cached item? 回答1: That is the way which .NET works because Cache just reference to the pointer of List . Don't

Should I use HttpRuntime.Cache?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 16:32:43
I'm a beginner in asp.net, and have a few question of Cache: HttpRuntime.Cache only provides severals methods and I think I'm able to implement these methods with Dictionary by myself. If HttpRuntime.Cache is much better than Dictionary, why some people would like to implement their own cache framework. How about MS Enterprise Cache Block? HttpRuntime.Cache only provides severals methods and I think I'm able to implement these methods with Dictionary by myself. You think wrong. HttpRuntime.Cache is much more than a simple dictionary. It offers thread-safety and cache expiration policies. It