Forum Moderators: open

Message Too Old, No Replies

.NET Caching

Any experience? E.g. best practices / dos and don'ts.

         

DWarp9

7:00 pm on Nov 8, 2006 (gmt 0)

10+ Year Member



Hello

I am currently in the planning phase of launching a community site, with all the usual grand ambitions :-)
I was thinking of using caching of the most frequently accessed articles/blogs/forum posts/whatever to minimize queries to the database. However, I am a little nervous about what this might mean memory-wise; Has anyone tried it with a community?

One idea I had was to compile a list of top x posts/articles/... via an algorithm (similar to what was discussed here [webmasterworld.com]). When these where accessed for the first time they would then be cached and kept in memory until the application ends. You could then specify a number of items to cache.
Has anyone tried this with success?

If not, I'll try it and let you know how it goes. ;-)

HalloweenMonster

9:49 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



As a first priority, use the ASP.NET built-in output caching. Whenever output caching applies it beats any other cache, as it bypasses most of the execution pipeline.

If page output caching is not feasible, use pagelet caching (output caching of user controls).

Only if these do not apply use data caching, i.e. caching the article data in memory.