updateQuery
suspend fun updateQuery(scopeName: String, template: String, bindings: Map<String, Any?>, payload: ByteArray, maxAgeMs: Long? = null, tags: List<String>? = null, bodyBytes: ByteArray? = null): String?
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.
Each metadata parameter has null-means-preserve semantics:
maxAgeMs =
null→ keep the existing entry's TTL.0L→ no explicit expiry.tags =
null→ keep the existing entry's tags.emptyList()→ explicitly clear. Non-empty → resolve as tag templates against bindings / bodyBytes and replace.
The freshness window restarts on every patch.
The bytes you supply must be in the same shape your API returns — Retrostash doesn't serialize for you. See the README's Cache API section for recipes covering kotlinx.serialization, Moshi, and Gson.