Closed peter1408 closed 3 years ago
There's no way of checking that; it's a huge problem, I agree.
Cached responses will have the request URL set to http://localhost/
!
You can simply check if response.raw().request().url().host() == 'localhost'
to see if it's a cached value.
@peter1408 @andreyrd I added a function for checking which response is rendered, as well as a function for deleting cache. I added a new demo app as well.
To install the new version change the implementation
line in Gradle, as mentioned in the README. The demo app is in the base folder as well.
I referred to this sample project of yours link
but how am I able to check if the value is loaded from the cache before the network response is rendered..
how to know if the response is the cache value or a network response???