You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both cache keys are calculated using the same method:
letcomputedKey= key.computedKey(with: identifier)
but you might notice, that above when calling the isImageCached(forKey:processorIdentifier:) method, ImagePrefetcher doesn't pass the processorIdentifier: parameter. This means that if the URL is example.com, ImagePrefetcher is checking (the md5 hash of) example.com to see whether there is a cached version, but when it goes to download and store the image, it is storing it at example.com@<processor_name>. This means that the ImageProcessor will never have a cache hit if you pass anything other than DefaultImageProcessor as an option.
This can be remedied by simply passing the processorIdentifier: parameter as such:
When you pass an
ImageProcessor
toImagePrefetcher
it will check to see if it exists in the cache like this:If that returns
false
it will continue on, download the image, process it, and store it like this:Both cache keys are calculated using the same method:
but you might notice, that above when calling the
isImageCached(forKey:processorIdentifier:)
method,ImagePrefetcher
doesn't pass theprocessorIdentifier:
parameter. This means that if the URL isexample.com
,ImagePrefetcher
is checking (the md5 hash of)example.com
to see whether there is a cached version, but when it goes to download and store the image, it is storing it atexample.com@<processor_name>
. This means that theImageProcessor
will never have a cache hit if you pass anything other thanDefaultImageProcessor
as an option.This can be remedied by simply passing the
processorIdentifier:
parameter as such:I will open a PR by EOD today that fixes this bug.
The text was updated successfully, but these errors were encountered: