ASP.NET 缓存对于 IIS7 中设置的每个主机标头是否独立
我有一个网站,可以根据域名主机名动态加载网站内容,由 IIS7 提供服务。所有域共享缓存的设置集合。看起来,几乎每个页面请求都会从缓存中刷新设置。这是通过记录 Cache 值为空并从 SQL 重新加载的时间来验证的。该代码在其他服务器和站点上按预期工作。 ASP.NET 缓存是否可能为每个域名主机名单独存储?
I have a site that dynamically loads website contents based on domain host name, served from IIS7. All of the domains share a cached collection of settings. The settings are being flushed from the cache on almost every page request, it seems. This is verified by logging the times at which the Cache value is null and reloaded from SQL. This codes works as expected on other servers and sites. Is it possible that ASP.NET Cache is being stored separately for each domain host name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
缓存是每个应用程序的,我会看看其他一些项目。
The cache is per application, I would look at a few other items.
另一件需要检查的事情是——有多少可用内存?一旦感知到内存紧缩,ASP.NET 缓存就会开始左右弹出内容。请记住,RAM 是昂贵且有价值的存储。 。 。
One other thing to check -- how much memory is available? The ASP.NET cache will start ejecting stuff left and right once it senses a memory crunch. Remember, RAM is expensive and valuable storage . . .
为您的站点设置不同的主机标头不会影响缓存。
您的缓存可能被刷新的原因有多种。我突然想到,要么你的 AppDomain 被转储,你的 web.config 文件正在更新,要么某些代码显式地过期/清除你的缓存。
Having different host headers for your site will not affect the cache.
There are a few reasons why your Cache might be getting flushed. Off the top of my head I would say either your AppDomain is getting dumped, your web.config file is getting updated, or some piece of code is explicitly expiring/clearing out your cache.