retrostash-core
The transport-agnostic cache engine. KMP-pure code (commonMain only) targeting Android, JVM, iOS, and wasmJs. Used by both the OkHttp/Retrofit and Ktor adapters; can also be used directly when wiring a custom transport.
Entry points
RetrostashEngine— central orchestrator. Owns aRetrostashStoreand aCoreKeyResolver; exposesresolveFromCache,persistQueryResult,invalidateTemplates,invalidateTags,clearAll.RetrostashStore— the storage interface. Implement it for custom backends; the defaultInMemoryRetrostashStoreis a thread-safe in-memory map suitable for tests and ephemeral caches.CoreKeyResolver— turnsQueryMetadatainto a stable cache key by resolving{placeholder}templates from bindings or JSON body fields.QueryMetadata— the per-request descriptor: scope name, key template, bindings, optional body bytes, and tag templates.
See also
The full README — installation, end-to-end examples, caching strategy, tags, and the FAQ.
retrostash-okhttpandretrostash-ktorfor the transport adapters.