Skip to content

//okhttp/okhttp3/Cache/initialize

initialize

[jvm]\ fun initialize()

Initialize the cache. This will include reading the journal files from the storage and building up the necessary in-memory cache information.

The initialization time may vary depending on the journal file size and the current actual cache size. The application needs to be aware of calling this function during the initialization phase and preferably in a background worker thread.

Note that if the application chooses to not call this method to initialize the cache. By default, OkHttp will perform lazy initialization upon the first usage of the cache.