retrostash-okhttp
OkHttp / Retrofit integration: an Interceptor that powers @CacheQuery and @CacheMutate plus a runtime-reflection extractor for Retrofit annotations. Targets Android and JVM.
Caching strategy
Retrostash is your annotation-driven cache. Don't pass
cache(...)to yourOkHttpClient.Builderunless you specifically want OkHttp's HTTP disk cache for origin-Cache-Control-drivenIf-None-Match/304revalidation — and accept that Retrostash invalidation does not evict OkHttp HTTP cache entries (treat OkHttp's cache like a CDN). After Retrostash invalidation, the next GET can still serve stale from OkHttp's HTTP cache (X-Retrostash-Source: okhttp-cache).
Read Caching strategy for the full guidance.
Entry points
RetrostashOkHttpBridge— top-level wiring. Holds the engine and store; exposesinstall(builder),cacheaccessor, and thefrom(client)recovery factory.RetrostashOkHttpCache— direct cache surface (peek / update / invalidate / clear), accessed viabridge.cache.RetrostashOkHttpAndroid— convenience factory that pairs the bridge with anAndroidRetrostashStore.RetrostashOkHttpConfig— tunables (timeouts, store caps, default TTL).RetrostashOkHttpInterceptor— the actual OkHttpInterceptor. Documents theX-Retrostash-Sourceheader values.Request-builder extensions:
retrostashQuery/retrostashMutatefor direct OkHttp consumers (no Retrofit annotations).
See also
retrostash-annotationsfor@CacheQuery/@CacheMutate.retrostash-coreforRetrostashStore/RetrostashEngine.
OkHttp / Retrofit integration: an Interceptor that powers @CacheQuery and @CacheMutate plus a runtime-reflection extractor for Retrofit annotations. Targets Android and JVM.
Caching strategy
Retrostash is your annotation-driven cache. Don't pass
cache(...)to yourOkHttpClient.Builderunless you specifically want OkHttp's HTTP disk cache for origin-Cache-Control-drivenIf-None-Match/304revalidation — and accept that Retrostash invalidation does not evict OkHttp HTTP cache entries (treat OkHttp's cache like a CDN). After Retrostash invalidation, the next GET can still serve stale from OkHttp's HTTP cache (X-Retrostash-Source: okhttp-cache).
Read Caching strategy for the full guidance.
Entry points
RetrostashOkHttpBridge— top-level wiring. Holds the engine and store; exposesinstall(builder),cacheaccessor, and thefrom(client)recovery factory.RetrostashOkHttpCache— direct cache surface (peek / update / invalidate / clear), accessed viabridge.cache.dev.logickoder.retrostash.okhttp.RetrostashOkHttpAndroid — convenience factory that pairs the bridge with an dev.logickoder.retrostash.okhttp.AndroidRetrostashStore.
RetrostashOkHttpConfig— tunables (timeouts, store caps, default TTL).RetrostashOkHttpInterceptor— the actual OkHttpInterceptor. Documents theX-Retrostash-Sourceheader values.Request-builder extensions:
retrostashQuery/retrostashMutatefor direct OkHttp consumers (no Retrofit annotations).
See also
retrostash-annotationsfor@CacheQuery/@CacheMutate.retrostash-coreforRetrostashStore/RetrostashEngine.