Deps:
- Kotlin 1.0.3
- Exoplayer r1.5.9
- Retrofit 2.1.0
- okhttp 3.4.1
Im trying to setup cache for my video playback project (list of videos of 20 secs per video) and Im wondering if theres any problem if I set the cache for OkHttp
val cacheSize: Long = 1000 * 1024 * 1024 // 1000 MB <-------- HERE
val cookieManager = CookieManager()
cookieManager.setCookiePolicy(java.net.CookiePolicy.ACCEPT_ORIGINAL_SERVER)
return OkHttpClient.Builder()
.cache(Cache(File(cacheDir, "responses"), cacheSize))
.cookieJar(JavaNetCookieJar(cookieManager))
- May have a Exceptions if I try to use
1000 MB
for cache? - How can I find the best cache size for my app without having issues?