cache never expires

  • Thread starter Thread starter fnustle
  • Start date Start date
F

fnustle

Asp.net cache expiration isn't working on the host that I've just moved
to. The cache just doesn't expire. It's not the code because it works
fine on my localhost and at my previous hosting provider.

HttpRuntime.Cache.Insert(XmlCacheKey,ds,null,Cache.NoAbsoluteExpiration,
TimeSpan.FromMinutes(1),CacheItemPriority.Normal,saveData)

I'm using it as a write-back cache that saves the in-memory dataset to
disk every minute if dirty and also on session end, so it's critical
that the cache expires.

I asked my hosting provider if they have disabled expiration using
<cache disableExpiration="false"/> and they said no.

Is there any other reason anyone can think of why the cache won't
expire?
 
How often is this item being accessed? If it's being accessed at least once
a minute then it won't expire from the cache. I'm just wondering if there is
something that could be scanning a file that makes use of this cached item,
causing it not to drop out of the cache.
 
Thank you for your reply.

It can't be that because it doesn't expire even when I stop the
application. (normally all cache is expired when application ends)
 
I've further narrowed the problem. What is actually happening is the
cache IS expiring but the callback method saveData is not being
called. Again this works fine in the development environment but not
in the hosting environment.
 
An additional piece of info is that the host environment is win2k3 and
my dev environment is win2k.
 
Back
Top