SweetzpotAS / StravaZpot-Android

A fluent API to integrate with Strava on Android apps
70 stars 36 forks source link

Retrofit response caching #19

Open mauron85 opened 6 years ago

mauron85 commented 6 years ago

Thank you for this amazing library. I noticed, that it's using retrofit, so my question Is if it's possible to enable response caching? https://futurestud.io/tutorials/retrofit-2-activate-response-caching-etag-last-modified

truizlop commented 6 years ago

Hi @mauron85, thanks for your feedback, I really appreaciate it. If you take a look at Config or its subclasses in the same package (AuthenticationConfig, StravaConfig), you can see that they accept a Retrofit instance in the constructor. They are able to create their own one, but you can provide one as well with the configuration it better fits your needs. In such way, you can create your Retrofit instance with response caching, pass it onto the Config constructor and continue using the library as it is. I hope that solves your issue.