OkHttpRetrostashMetadata

data class OkHttpRetrostashMetadata(val scopeName: String, val queryTemplate: String? = null, val maxAgeMs: Long = 0, val bindings: Map<String, String> = emptyMap(), val invalidateTemplates: List<String> = emptyList(), val tagTemplates: List<String> = emptyList(), val invalidateTagTemplates: List<String> = emptyList())

Per-request OkHttp metadata read by RetrostashOkHttpInterceptor. Attach via the retrostash, retrostashQuery, or retrostashMutate extension on okhttp3.Request.Builder.

For Retrofit users this is populated automatically from @CacheQuery / @CacheMutate via RetrofitMetadataExtractor — manual attachment is only needed when calling OkHttp directly.

Constructors

Link copied to clipboard
constructor(scopeName: String, queryTemplate: String? = null, maxAgeMs: Long = 0, bindings: Map<String, String> = emptyMap(), invalidateTemplates: List<String> = emptyList(), tagTemplates: List<String> = emptyList(), invalidateTagTemplates: List<String> = emptyList())

Properties

Link copied to clipboard

Pre-extracted placeholder values.

Link copied to clipboard

Tag templates to resolve and clear on a 2xx mutation response (mutation side, parallel to invalidateTemplates).

Link copied to clipboard

Templates to clear on a 2xx mutation response.

Link copied to clipboard

TTL in milliseconds for persisted entries. 0 disables persistence.

Link copied to clipboard

Cache template; non-null marks this request as a query.

Link copied to clipboard

Logical namespace (typically the API interface name).

Link copied to clipboard

Tag templates to resolve and persist with the cached entry (query side).