Hi, trying to debug a caching issue using the KTor...
# ktor
b
Hi, trying to debug a caching issue using the KTor client - is there a way to check if the response came from the cache or a fresh request?
Copy code
val client = HttpClient {
    install(HttpCache) {
        publicFileStorage(Files.createDirectories(Paths.get("build/cache/public")).toFile())
        privateFileStorage(Files.createDirectories(Paths.get("build/cache/private")).toFile())
    }
}
val response = client.get("...")

// val fromCache: Boolean = response.isFromCache() //<- something like this
a
Unfortunately, the response object retrieved from the cache cannot be distinguished from the normal response. The only way I know is to debug the
HttpCache
plugin.