pokekotlin icon indicating copy to clipboard operation
pokekotlin copied to clipboard

Auto-caching

Open Selim042 opened this issue 6 years ago • 2 comments

Are there plans to add auto-caching to this wrapper? I am looking at using this and would like to cache the results, but preferably not have my own wrappers that cache the results. I'd look into doing this myself, but I am not familiar with Kotlin.

Selim042 avatar Oct 07 '19 17:10 Selim042

This should be doable by adding a caching interceptor to the OkHttp client, like this: https://medium.com/@bapspatil/caching-with-retrofit-store-responses-offline-71439ed32fda

I'm not sure if I'll implement it, but I'd welcome a PR that adds this option.

sargunv avatar May 06 '20 06:05 sargunv

@Selim042 It does mean you need to rebuild your cache after every deploy. It would definitely be an improvement. But there is no way around it to sort your own persistent caching like redis/hazelcast

patrickdronk avatar Jun 16 '20 18:06 patrickdronk