RetrostashPlugin

Ktor HttpClient plugin that adds annotation-style query caching and mutation invalidation.

Installs request/response hooks that:

Wire metadata onto a request with retrostashQuery / retrostashMutate.

val client = HttpClient {
install(RetrostashPlugin) {
store = InMemoryRetrostashStore()
timeoutMs = 250
}
}

client.get("https://api.example.com/feed/7") {
retrostashQuery(
scopeName = "FeedApi",
template = "feed/{id}",
bindings = mapOf("id" to "7"),
maxAgeMs = 60_000L,
)
}