bumptech / bumptech/glide

The same url but with different priority

Open
#4,804 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

Hi,

I need to preload a lot of images with different priorities.
I'm doing it like this:
```
model.images.map { item ->
val target = GlideApp.with(contextProvider.get())
.load(imageMapper.map(model.settings, item.image))
.priority(item.priority.toGlidePriority())
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.preload()
target.request
}.let { requests -> requestsCache.addAll(requests) }
```

In the same time app could try to load the same image because it was requested from UI:
```
GlideApp.with(to.context)
.load(image.url)
.priority(Priority.IMMEDIATE)
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.set(Downsampler.ALLOW_HARDWARE_CONFIG, allowHardwareImages)
.into(to)
```

The question is what will be in this case with requests? Will UI request start other request or will it pick first?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.