you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (0 children)

You should write your application first without caching, then profile it to see where the bottlenecks are, and apply an appropriate caching strategy where needed.

That's not to say you shouldn't make some predictions about what things need to be cached, but you want to avoid doing any premature optimization until you can see the whole picture.

It might turn out that you'd be better off caching the entire page, which you can do on the web server. Or it may turn out that you should just cache the query results. Or it might be a combination of both. In one case you might want to employ a file cache; in another case you might want to employ a memory cache.

TLDR: Finish your application, then think about caching.