educative.io

Cache Invalidation

So who does the cache invalidation. Cache server itself or application should handle this. ?
I mean when you say that during write around cache process. We write data to DB not to the cache so when cache miss happens then then we will do read from DB and then update the cache. Will this be done by cache server or application has to do it.?
So also while updating data in DB how the cache invalidation will look like. Since cache miss won’t happen in cache update . So imagine application update value in DB who will update the cache in write around scenario? After new value is updated in DB and when read is being asked that time cache miss won’t happen since cache has the value but its stale one.