Caching
IndexedDB for browser flag snapshots. Server ETag for meta.
Last updated on
The browser SDK stores the last flag snapshot in IndexedDB when a cache is available (the default when indexedDB exists and flags.cache is not false). start() paints that snapshot before the network refresh, then replaces it when evaluate-public returns.
The cache key includes the API host and the client key, so two projects do not share a database. TTL can be set with flags.cacheTtlMs.
Node does not enable that browser cache. Pass flags.cache yourself if a server process must reuse a snapshot. For React server rendering, call exportFlagState() and pass the result as serverFlagState instead of sharing a process-wide cache blindly across users.
/meta uses ETag. Send If-None-Match to avoid reparsing an unchanged version.
Was this page useful?