Fragment Cache – an introduction
The message to take away is that caching should not be done afterwards. It should be part of the design process. Not only will this decrease the chance of missing a cache expiration point, it will also guide you to write more optimal code. Each time you add a data dependency you are forced to think about it. Is it really necessary? Can it be made more specific so that the cache does not need to be rebuilt as often?