Glide Cache is not saved when the application is killed

I track my web calls with Charles.

I have a GlideModule cache change folder, overriding applyOption (...) as follows:

    @Override
public void applyOptions(Context context, GlideBuilder builder) {
    builder.setDiskCache(
            new InternalCacheDiskCacheFactory(context, "/media/", 1500000)
    );
}

Then I upload the Glide images and the cache works fine while I enter the application. Here is an example:

Glide.with(this)
            .load("http://www.wired.com/wp-content/uploads/2015/09/google-logo.jpg")
            .into(mImageView);

Only the first call makes a web call and then uses the cache to receive it. However, if I kill the application, restart it, instead of continuing to use the cache, the application will make a new web call. Shouldn't the cache remain constant inside the internal storage?

+4
source share

Source: https://habr.com/ru/post/1628142/


All Articles