RetrostashKtorCache
Direct cache control for the Ktor adapter — peek, update, invalidate*, clearAll. All methods are suspend; call from any coroutine. Mirror surface of RetrostashOkHttpCache but uses scopeName: String instead of Class<*> for KMP compatibility, and stores raw bytes (no envelope — Ktor doesn't synthesize HTTP responses on cache hit, the plugin hands the bytes back via RetrostashCachedPayloadKey).
Full guidance — including how to source the bytes for updateQuery from typed responses and the converter-agnostic philosophy behind that — lives in the README: Cache API.
Obtained via RetrostashKtorRuntime.cache.
Functions
Invalidates a single template/key directly, bypassing annotation extraction.
Removes every cached entry whose tag set contains tag. The tag must be the resolved value (e.g. "article:concept123").
Bulk version of invalidateTag. Blank values skipped.
Returns the cached payload bytes for a query, or null if no entry, the placeholders couldn't be resolved, or the store call timed out. Decode with whatever serializer you used to write the entry.
PATCH-style write. Persists payload under the resolved cache key for the given query. Returns the resolved cache key, or null if any placeholder couldn't be resolved.