import { IncrementalCache } from '@opennextjs/aws/types/overrides'; /** * Cimplify incremental-cache override for Workers for Platforms storefronts. * * Replaces opennext's stale-while-revalidate model with an evict-on-invalidate * model that fits Cimplify's event-driven domain: * * - `get`: standard R2 fetch. Returns the cached value or null. * - `set`: reserves a tag→cache_key index update in the shared * `CIMPLIFY_PATH_INDEX` Durable Object, writes the value to R2, then * confirms that no eviction crossed the write. A tagged value is never * cached unless its eviction index is durable and its reservation remains * current. * - `delete`: standard R2 delete (called by opennext on explicit invalidate; * also called by us from the Rust EvictionDispatcher path on tag events). * * The Rust EvictionDispatcher signals the tag-cache worker on bus events. That * worker fences new writes, reads the index, deletes matching R2 entries, and * purges the dispatch worker's per-script HTML cache tag. A write whose * reservation was crossed by that fence deletes its just-written R2 object. * There is no SWR "background refresh" path: opennext's queue and `isStale` * checks are no-ops, and an R2 miss makes the next request synchronously * re-render. * * Why this exists: WfP user workers cannot have `WORKER_SELF_REFERENCE`, * which is the binding every built-in opennext queue requires. Rather than * recreate SWR via self-fetch tricks, we drop SWR for our domain — Cimplify * always knows when data changes (every catalog mutation flows through the * bus), so timer-based refresh adds no value. */ declare const evictIncrementalCache: IncrementalCache; export { evictIncrementalCache };