Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image download requests not deduplicated #825

Open
MartinStrambach opened this issue Dec 15, 2024 · 0 comments
Open

Image download requests not deduplicated #825

MartinStrambach opened this issue Dec 15, 2024 · 0 comments

Comments

@MartinStrambach
Copy link

MartinStrambach commented Dec 15, 2024

I have the following setup:

struct Model {
		let url: String
		let size: CGSize
		let priority: ImageRequest.Priority
		let cacheType: CacheType
		let transaction: Transaction
		let additionalProcessor: [ImageProcessing]
}
LazyImage(url: URL(string: model.url), transaction: model.transaction) { state in
			if let image = state.image {
				image
					.resizable()
					.aspectRatio(contentMode: .fill)
					.frame(width: model.size.width, height: model.size.height)
			}
		}
		.priority(model.priority)
		.processors([.resize(size: model.size)] + model.additionalProcessor)
		.pipeline(
			ImagePipeline(
				configuration: .withDataCache(
					name: model.cacheType.rawValue,
					sizeLimit: 1024 * 1024 * model.cacheType.size
				)
			)
		)
}

The use case is the same as in the documentation where I have two images (one blurred) on top of each other. If I comment out ImagePipeline, I see one request per unique image. Unfortunately, with ImagePipeline with disk caching it doesn't work and 2 requests are fired for a unique image.

Xcode 16.2
Nuke 12.8
iOS 18.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant