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.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |