I just read the Two Reasons You’re Not Using the Cache and How To Deal With Them article on VSMag. Overall, I like the intention of the article which is to promote caching, but I have some issues with some of the points made.
In the article, Peter addresses two of the common reasons that cause people to not use caching. These are data being stale and losing data. There is some good advice regarding stale data. People need to determine the volatility of their data to decide on cache expiration policies. There are also some notification services that can be used to flush the cache when data stores are updated.
The article then discusses issues about losing data. This is where I don’t like the guidance provided. What I can’t agree with in the article is the concept of having the cache as the source of truth of the application data. The article promotes the idea of keeping application data in the cache (usually in memory) when it is created or updated and only providing that information to the back-end data store when the item is removed from the cache.