Optimal ASP.Net cache duration for a large site?

Posted by HeroicLife on Stack Overflow See other posts from Stack Overflow or by HeroicLife
Published on 2010-06-02T17:55:23Z Indexed on 2010/06/02 22:54 UTC
Read the original article Hit count: 124

Filed under:
|
|
|

I've read lots of material on how to do ASP.Net caching but little on the optimal duration that pages should be cached for.

Let's say that I have a popular site with 50,000 pages. The content does not change frequently, so I could cache pages for up to an hour if I wanted. The server has 16 GB of RAM, but database connections are limited.

How long should pages be cached for?

My thinking is that if I set the cache duration too high (let's say 60 minutes), I will fill up memory with a fraction of the total content, which will continually be shuffled in and out of memory.

Furthermore, let's say that 10% of the pages are responsible for 90% of traffic. If the popular pages are hit every second, and the unpopular ones every hour, then a 60 second cache would only keep the load-intensive content cached without sacrificing freshness.

Should numerous but rarely-accessed content be cached at all?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about caching