When you create a cache, you should always implement a switch that allows you to set caching off when needed. I cannot tell you how much time this has saved me while debugging my code. When you do switch off the cache, make sure you also clear it out before continuing, else you might see some unexpected behavior and cause “memory leaks.” Given that this is so useful, I always implement my caches with this functionality and so I have made it a part of the Caching Architecture, which now basically looks like this:
In the next part of this series we will add even more functionality to the cache and try to find solutions for some of the drawbacks we mentioned earlier.
blog comments powered by Disqus |