ASP.NET数据缓存 - 应用程序域重新启动后,preserve内容 [英] ASP.NET Data Cache - preserve contents after app domain restart
问题描述
我使用ASP.NET的数据缓存API。例如:
HttpRuntime.Cache.Insert(my_data,my_key);
有什么办法来配置缓存,这样它的内容是preserved当应用程序域回收?
我加载许多对象到缓存中,但有一个实质性的延迟重新加载这些每次应用程序域重新启动。承担这个问题,我不能prevent的AppDomain重新启动因服务器配置。
有什么办法来配置缓存,这样
其内容是preserved当
应用程序域回收?
块引用>没有。 Cache对象持有RAM引用。期。
替代:
- 外的进程外会话状态(虽然这是每个用户)
- 分布式缓存
- 使用SQL Server作为一个高速缓存(如果它使数据在内存中,而不是在磁盘上)
- 写的对象磁盘在web层
我一般$ P $#PFER自己3,虽然有场景中的人是合适的。
I am using ASP.NET's data caching API. For example:
HttpRuntime.Cache.Insert(my_data, my_key);
Is there any way to configure cache so its contents are preserved when the App Domain recycles?
I load many object into cache, but there is a substantial delay re-loading these every time the app domain restarts. Assume for this question that I can't prevent the appdomain restart due to a server configuration.
解决方案Is there any way to configure cache so its contents are preserved when the App Domain recycles?
No. The Cache object holds references in RAM. Period.
Alternatives:
- Out-of-process Session state (although that's per-user)
- Distributed cache
- Use SQL Server as a cache (where it keeps data in memory, rather than on disk)
- Write the objects to disk at the web tier
I generally prefer #3 myself, although there are scenarios where the others are appropriate.
这篇关于ASP.NET数据缓存 - 应用程序域重新启动后,preserve内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!