0

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?

Corgalore
  • 2,486
  • 2
  • 23
  • 32

3 Answers3

1

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.

Peter
  • 9,643
  • 6
  • 61
  • 108
0

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
Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
0

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 . . .

Wyatt Barnett
  • 15,573
  • 3
  • 34
  • 53
  • As it turns out Wyatt, I believe RAM availability is our problem. Despite the resource monitor displaying plenty of unused RAM, everything points to Cache being flushed by system trying to recover memory. – Corgalore Dec 29 '10 at 04:41