import { type LoaderModule } from "https://deno.land/x/live@1.107.0/blocks/loader.ts";
Properties
Specifies caching behavior for the loader and its dependencies.
-
no-store:
- Completely bypasses the cache, ensuring that the loader always runs and fetches fresh data.
- This setting also changes
ctx.vary.shouldCache
tofalse
, which prevents other dependent sections from being cached. - The
vary
is not set, even if the loader has a cache key.
-
no-cache:
- Ignores the cache for the current loader run, but does not affect the caching behavior of other dependent blocks.
- This is useful for loaders that should always execute but whose results can still be cached.
-
stale-while-revalidate:
- If no data exists for a cache key, the loader runs, and the fresh data is returned.
- If stale data is available, it is returned immediately while the loader runs in the background to revalidate and update the cache if the data is outdated.
optional
deprecated
singleFlightKey: SingleFlightKeyFunc<TProps, HttpContext>