N
ningjun.wang
I set outputcache to 30 minutes for all .aspx pages on my asp.net 2.0
websites. If a search engine (such as Google) crawl my site, it can hit
thousands of pages within a few minutes and thus produce a large amount
of page caches. This could use a lot of memory and impact other
websites running on the same machine. My question is: how can I limit
the memory size (e.g. to 100MB) used by the cache?
I can set the following in web.config:
<cache privateBytesLimit = "128000000" />
This means the cache starts flushing expired items and attempting to
reclaim memory when memory size exceed 100MB. However if all cached
pages are unexpired, then no memory are reclaimed and memory size will
continue to grow as new pages get cached. How can I force cache to
remove items even if they are not expired yet so that memory will never
exceed 100MB? Is there a configuration setting to achieve this?
Ningjun
websites. If a search engine (such as Google) crawl my site, it can hit
thousands of pages within a few minutes and thus produce a large amount
of page caches. This could use a lot of memory and impact other
websites running on the same machine. My question is: how can I limit
the memory size (e.g. to 100MB) used by the cache?
I can set the following in web.config:
<cache privateBytesLimit = "128000000" />
This means the cache starts flushing expired items and attempting to
reclaim memory when memory size exceed 100MB. However if all cached
pages are unexpired, then no memory are reclaimed and memory size will
continue to grow as new pages get cached. How can I force cache to
remove items even if they are not expired yet so that memory will never
exceed 100MB? Is there a configuration setting to achieve this?
Ningjun