Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / January 2007

Tip: Looking for answers? Try searching our database.

How to limit the memory size for asp.net cache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ningjun.wang@lexisnexis.com - 17 Jan 2007 04:42 GMT
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
Alvin Bruney [MVP] - 20 Jan 2007 11:47 GMT
Answered in ASP.NET framework.

Signature

Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc

>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
[quoted text clipped - 14 lines]
>
> Ningjun

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.