enable http cache for retrofit

This commit is contained in:
Bnyro 2022-09-10 19:35:05 +02:00
parent 0070583c11
commit d3d82a7d0f

View File

@ -11,8 +11,12 @@ class CronetHelper {
fun initCronet(context: Context) {
engine = CronetEngine.Builder(context)
.enableHttp2(true)
.enableQuic(true)
.enableBrotli(true)
.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 1024L * 1024L) // 1MiB
.build()
callFactory = CronetCallFactory.newBuilder(engine)
.build()
}