Optional ReadonlybypassReturning true skips the cache entirely for this request.
Optional ReadonlycacheThe cache handle. Omitted resolves caches.default from the global scope;
when that is also absent — every runtime other than Cloudflare Workers —
the middleware passes through instead of throwing.
Optional ReadonlycacheableStatuses worth caching. Defaults to [200]. Does not override the
platform's unconditional refusal of 206.
Optional ReadonlykeyBuilds the cache key from the request. Omitted uses the full request URL,
which is what the platform's own cache keys on — plus, when the request
carries a resolved ctx.request.tenant (the multi-tenancy plugin) and/or
ctx.request.locale (the localization plugin), a setu-cache-tenant and
a setu-cache-locale query parameter naming them, appended last. The key
is a URL STRING, so the platform matches it with no request headers and
Vary cannot separate entries here. The tenant and locale in the key are
the ones present when this middleware runs, so it must run AFTER the
tenant and locale middleware: a GLOBAL registration needs a higher
priority number than theirs (40 and 45 by default, or the configured
priorities); where either is applied per route instead, this one must be
too, listed after it; and a replaceTenant or replaceLocale made inside
the handler is not reflected — such a route must not be cached here. That
priority is a LOWER bound only: a global registration still runs before
passive authentication (300) and every guard, so a HIT is served without
them — inherent to global response caching, as with cache-plugin. A
response that depends on who is asking belongs behind a per-route
registration listed after its guards. A custom key replaces all of this
and must include the tenant and locale itself.
Optional ReadonlyttlAdds Cache-Control: public, max-age=<n> to the stored copy when the
response carries no Cache-Control of its own. The edge honors the stored
response's own directive, so without one an entry has no freshness lifetime
and is of little use. The client's response is left untouched.
Options for
cacheApiMiddleware.Since
0.2.0