dmytro-anokhin / url-image

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.
MIT License
1.1k stars 96 forks source link

Use customized `urlRequestConfiguration.cachePolicy` in requesting #177

Open torufuruya opened 11 months ago

torufuruya commented 11 months ago

Is your feature request related to a problem? Please describe.

I'm observing some of my image URLs are not fetched from the remote source once 404 responses for that were cached (Is it expected behavior in the first palce?). So I tried to change urlRequestConfiguration.cachePolicy but it seems only urlRequestConfiguration.allHTTPHeaderFields is used.

Describe the solution you'd like

If my understanding is correct, it can be done by setting the download.urlRequestConfiguration.cachePolicy on making the URLSessionTask in URLSessionCoordinator. https://github.com/dmytro-anokhin/url-image/blob/main/Dependencies/Sources/DownloadManager/URLSession/URLSessionCoordinator.swift#L166-L167

Describe alternatives you've considered

N/A

Additional context

N/A