Haneke / HanekeSwift

A lightweight generic cache for iOS written in Swift with extra love for images.
Apache License 2.0
5.21k stars 591 forks source link

Best way to determine, instantly, if an image is already on the device in cache? #414

Closed smhk closed 6 years ago

smhk commented 7 years ago

You have a URL url and you want the image. It could be we already have it cached on the device.

Is there a way to "instantly" determine if url is in cache?

The call

imageCache#fetch#onSuccess

is asynchronous. It returns the image. So it is very slow if the image is huge.

How to just determine, quickly if the image for a given URL is already cached? Cheers