Each instance has its own cache, and the update only invalidated the copy on the instance that handled it
Each instance has its own cache. The update only invalidated (removed) the copy on the instance that handled the request. A process-local cache lives inside one process, so other instances can't see it. The other three instances keep serving their stale (old) copies until their entries expire.
Two fixes:
• Use one shared Redis cache for all instances.
• Broadcast the invalidation to all instances with Redis Pub/Sub, so each one removes its copy.
"The load balancer caches responses" is wrong: a load balancer only spreads requests across instances. The stale data comes from each instance's own Map.
Read more