in reply to Improving performance by generating a static html file?
What I mean by that is design your system so that you can tell when a change has been made, so you always know when you need to regenerate your HTML.
So to translate this to your system, when a thread has an addition, generate the HTML code, store it, and mark the thread as clean.
Next time that thread is viewed, you only need to make a single database lookup to decide if you can re-use the HTML or not. If it's still clean, go for the cached version.
When additions are made to the thread, simply mark the thread as 'dirty', and the next time it's viewed, the HTML will be generated again.
Issues to think about here are concurrency, and also making sure everything that can affect the thread updates the dirty flag.
|
---|