ASP.NET 缓存对于 IIS7 中设置的每个主机标头是否独立

发布于 2024-10-09 00:07:01 字数 162 浏览 0 评论 0原文

我有一个网站,可以根据域名主机名动态加载网站内容,由 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一江春梦 2024-10-16 00:07:02

缓存是每个应用程序的,我会看看其他一些项目。

  1. 您的应用程序池是否回收(超时、内存限制、文件更改等)
  2. 您是否启用了 Web Gardening,这将为每个花园线程创建不同的存储桶

The cache is per application, I would look at a few other items.

  1. Is your application pool recycling (Timeout, memory limit, file changes, other)
  2. Do you have Web Gardening Enabled, this would create different buckets for each garden thread
抹茶夏天i‖ 2024-10-16 00:07:02

另一件需要检查的事情是——有多少可用内存?一旦感知到内存紧缩,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 . . .

浪推晚风 2024-10-16 00:07:01

为您的站点设置不同的主机标头不会影响缓存。

您的缓存可能被刷新的原因有多种。我突然想到,要么你的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文