Hi Santosh,
That would be the holy grail ;)
The simplest way would to invalidate/empty the cache when you do a write transaction to a certain endpoint. You can do this by using fetchEvent to fire on put/post/delete. Then in that function use the cache/cacheStroage to remove the current cache for that end-point.
Regards
Sander