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

Already on GitHub? Sign in to your account

Lazy loading with no-cache parameter, clearing the cache #3

Closed
mtedesco opened this Issue Aug 6, 2010 · 2 comments

Comments

Projects
None yet
3 participants

mtedesco commented Aug 6, 2010

SDWebImage is great. Very plug-and-play. Appreciated!

Two use-cases I'd like to see covered in the project:

  1. Ability to call SDWebImage for lazy-loading into UITableView with a parameter that prevents the image object from being cache. Example: For serving instream advertisements in a UITableView, I want to pull a fresh image every time. However, I still want to use SDWebImage because it provides simple lazyloading functionality.
  2. Simple method to clear the entire cache, and force all content to be reloaded.

Would the author consider adding these into the SDWebImage roadmap?

Again, great project - many thanks for distributing this!

Owner

rs commented Oct 3, 2010

To clear the entire cache use this (mem+disk):

SDImageCache *imageCache = [SDImageCache sharedImageCache];
[imageCache clearDisk];
[imageCache clearDisk];

To disable the cache, it's not possible as of today. I will add some more control over the cache in future release like the ability to set a max capacity in complement to the current expiration based cache eviction.

jocull commented Dec 9, 2010

I just wanted to verify that this is correct. I appears to me that you need to run the commands like this to clean and clear both memory and disk (notice _clear_ vs. _clean_):

SDImageCache *imageCache = [SDImageCache sharedImageCache];
[imageCache clearMemory];
[imageCache clearDisk];
[imageCache cleanDisk];

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment