What Exactly Stale data mean ? How can we Handle this in Cache ?
I'm going through Cache and found about stale data. How we can handle it?? How release the stale data if it is not being used? Can someone brief about it ??
On
Stale Data: The data in cache is outdated with respect to the main memory. How to handle this issue:
I too would like some other scenarios where stale data can come into picture.
Once you store data in a cache, it's like a snapshot of the data. If the data changes, you must flush the cache and reload the data.
Think of it like taking a snapshot of your friends at a sporting event. Once the event is over and your friends leave, the snapshot is 'stale'. It no longer reflects the true status.
Typically, when you know the data has changed, you should flush the cache and let it build back fresh.