mrjaxon
5/17/2007 9:00:00 PM
We are working on migrating an enterprise web application from 1.1 to
2.0 and we have run into a fairly significant issue in regards to the
caching. The application is designed to cache entire pages in memory
using HttpRuntime.Cache and keep them there till they expire (usually
1 - 3 minutes). The problem we encountered is that .NET 2.0 is overly
aggressive when it reclaims memory and tosses pages out of mem after
only a few seconds because they are "Underused". This means that
pages never stay in cache as long as they are supposed to and the
percentage of pages served from memory goes WAY down.
We have tried a few different solutions to this problem so far
including disabling memory collection altogether in the machine.config
which was somewhat disastrous. We cannot pin pages into the cache
because there are far too many in the system and pinning will lead to
OutOfMemoryErrors. What we really need is for the cache to function
as it did in 1.1 where mem was polled every second or so and expired
pages were removed while others were left alone. Is there any way to
get this functionality (or a similar one) using the 2.0 framework?