I have couple requests that return different results depending of header value. I implement caching mechanism for them and its working fine for different urls but okhttp is probably take only urls (without the headers values) so I got the same result for different header values.
Is there a way to force OkHttp to take in consideration headers as well? It can be just one value of the header.
Example:
1. "https/domain/items" Header - ShopId=123
2. "https/domain/items" Header - ShopId=124
For instance I cache response 1 go to screen which use request 2 cache that data as well and go back to screen 1 and try to get cached data – I will obtain request 2 data
Unfortunately I cannot change how API works.
I think about overriding CacheStrategy in okhttp lib but honestly don’t know how to do it and whats more use it in the client