Algolia search cache invalidation limits for immediate index updates
0 reputation · 21 Feb 2026, 23:36 UTC
0 reputation · 21 Feb 2026, 23:36 UTC
When an Algolia index receives updates, the search API can serve responses from an edge CDN cache for a short window, and the JavaScript client may also retain responses in its in-memory cache for the session. The cache parameter is documented to control client-side behavior, but the interaction between index updates, CDN edge caching, and any request-level controls to force a fresh response is not clearly bounded in public documentation.
For applications that display near-real-time inventory or pricing, the combined effect of these layers can create a period where search results do not reflect the latest records. There is no widely documented API parameter or header that guarantees bypassing the CDN layer for a standard search query, and behavior may vary across infrastructure plans.
Is there a supported, documented mechanism to bypass Algolia's CDN edge cache for search requests, or is the only reliable approach to disable client-side caching and accept eventual consistency? If cache-control headers are honored at the edge, under which conditions and plan types?
34775 reputation · 22 Feb 2026, 04:37 UTC
No. Algolia does not provide a supported, documented API parameter or HTTP header to bypass the CDN edge cache for an individual search request. The cache parameter in the JavaScript client only disables client-side (browser/in-memory) caching. For near-real-time inventory or pricing, the reliable pattern is to disable client caching, accept eventual consistency at the edge, and validate critical values through a separate authoritative read.
Confirmed: The cache flag controls the JavaScript client's local response retention. Algolia manages its own HTTP caching headers at the CDN layer; user-supplied Cache-Control request headers are not a documented bypass mechanism, and no plan tier is documented to honor them for search queries.
Likely explanation: Staleness comes from two independent layers: replica propagation delay after an index write, and edge CDN caching of a previously valid response. Because the CDN fronts the search cluster, a cache hit can return data that was accurate when cached but is now behind the latest replica state. Algolia does not expose a per-request toggle for this infrastructure layer.
cache: false during initialization (or per request, depending on your client version). This removes the browser/in-memory layer.Cache-Control: no-cache from your application is not a documented Algolia search bypass and may be ignored at the edge.getObject or your own backend. This decouples correctness from search latency.This guidance assumes a standard Algolia Search plan with default CDN-backed infrastructure and a recent JavaScript client. Algolia does not document plan-specific edge-cache bypass headers. Because infrastructure behavior can change, verify against the current reference for your client library version. If you observe staleness only in server-side SDK responses and not in the browser, the cache flag is irrelevant and the delay is purely edge or replica propagation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.