Does Vue Storefront ensure cache consistency across distributed middleware nodes?
23K reputation · 26 Nov 2020, 16:15 UTC
Distributed Cache Invalidation
Vue Storefront utilizes a middleware layer to decouple the frontend from backend APIs, often implementing caching strategies to minimize latency. In clustered environments where multiple middleware instances are deployed, the system must synchronize cache purges to prevent stale data from being served to users.
While the framework supports the stale-while-revalidate pattern and integrates with backend webhooks for invalidation, there is uncertainty regarding the propagation of these purge events across a distributed architecture. If a webhook triggers a cache clear on a single node, other active nodes may continue serving outdated product prices or stock levels until their respective TTL expires.
- Are cache purge events broadcasted to all middleware instances in a cluster?
- Which mechanism ensures global consistency when using a distributed cache layer?