This is where you look at a performance analysis of the item. It depends on your your caching scheme and the nature of your data. There are a few basic principles behind a cache mechanism that you need to take note of (this is midly off topic). Keep in mind always that a cache is the epitome of the classical space/time tradeoff. With that in mind:
- Is the data that you are generating dynamically mostly static or mostly dynamic? This is really important to consider. If you are generating basically the same thing over and over again, then it's fairly cache-safe. If it changes a lot (has the times the poster last logged in, how many posts they've made, or replies come in often), then your stored information has the probability of being "dirty", and thus useless to store somewhere.
- Is the overhead of the caching worthwhile? Are you typically going to do a lot of mucking with the data to store it? Are you putting the cache on disk or in a database? These are questions you will have to answer for yourself to come up with the right answer, but performance tuning will be involved. Start the caching, and see what hits the cache and what misses it.
- Can you afford the space/time tradeoff? Do you have the space available to store the cache? Do you have a mechanism in place to clean the cache once it becomes to old (to keep it efficient)?
Those reflections should be able to answer your questions for yourself. If you're looking into perl modules:
Or you can roll your own solution taylored to meet your needs. Have fun with the project
--
jb