Search code examples
performancecachingprojects

Which kind information to cache in memory?


It's easy to decide which information to cache in memory in a node-like web-site, where you have few nodes, most popular pages, you can keep in memory. But what about sites where the whole mass of pages has same chances to be required?

For example - Wiki-sites or social nets?

added

Something's wrong with "add comment" button... Well, actually, I ask question like "something hurts, doctor, help me", isn't it?)

So, after logical caching of static part of site, you can only cache as much ready results as you can (not in memory, but somewhere). That's all you can do, сorrect me if I'm wrong.


Solution

  • Caching makes sense if and only if you have some (spatial, temporal) locality, such as the most frequent queries (temporal locality). If you have a model where each page is fetched with uniform probability, then caching is a complete nonsense, yes.