I am developing an application where there can be many identical pictures on one screen (SVG from the server).
When I open the application for the first time, I see multiple parallel requests behind the same picture.
I think it's worth adding a pool of downloads, and if this URL is already being processed, do not make this request again, but wait for the first one to complete and use its result.
override fun onCreate(savedInstanceState: Bundle?) {
CODE
Coil.setImageLoader(
ImageLoader
.Builder(this)
.components { add(SvgDecoder.Factory()) }
.crossfade(true)
.build()
)
CODE
}
AsyncImage(
placeholder = rememberAsyncImagePainter(R.drawable.ic_plchldr),
error = rememberAsyncImagePainter(R.drawable.ic_plchldr),
model = URL,
contentDescription = URL,
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxSize()
)

I am developing an application where there can be many identical pictures on one screen (SVG from the server).
When I open the application for the first time, I see multiple parallel requests behind the same picture.
I think it's worth adding a pool of downloads, and if this URL is already being processed, do not make this request again, but wait for the first one to complete and use its result.