-
Notifications
You must be signed in to change notification settings - Fork 361
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
checking if image is cached #79
Comments
@DanielRanLehmann You can obviously just call objectForKey, but that will instantiate the object off disk which if you just want to check if it's available is expensive. Instead, you can access the memoryCache and diskCache directly. objectForKey on the memory cache will determine existence (and isn't expensive). fileURLForKey is the cheapest way to check existence on the disk cache. I'd be happy to accept a pull request which exposes methods on the memoryCache, diskCache and PINCache to essentially do this all. |
Thanks for the quick response 👍 I will look into it right away and make a pull request if it works out.. |
@garrettmoon I think this can be closed:) |
Thanks! |
I might be missing something obvious. I'm using PINcache to store my images that is async plugged into a custom cell in a collectionView.
How can I check if an image is cached?
Is there any similar method to SDWebImage where you can check if an image is cached on disk like this:
The text was updated successfully, but these errors were encountered: