1

I am using SDWebImage in my pictures ios app.

The user enters a number and click on "OK", then I will open a UIImageView with a specific picture related to that number. I'm doing this by using:

[myImageView sd_setImageWithURL:imageUrl];

However I have something like 1000 images. So when the app starts I am calling:

[[SDWebImagePrefetcher sharedImagePrefetcher] prefetchURLs:arrayWIthAllMyImages];

According to the document, this will prefetch all my images in the background, that way displaying them would be quick if they are cached.

My Question:

  • Consider this scenario: the prefetcher is still downloading the images, and the user open an image and I set it using sd_setImageWithURL, but this specific image was not yet downloaded. Is there a way I can tell SDWebImage to give priority to this specific image so it displays quickly for the user, without having to wait it's turn to come?

This might be done like that, but I just want to confirm because I don't have a lot of images at this moment, but I might reach that stage. Thanks a lot for any clarification.

Y2theZ
  • 10,162
  • 38
  • 131
  • 200
  • In most cases, pre-fetching won't be nearly as beneficial as you might expect. On a mobile device, power and bandwidth are limited resources, which calls into question the value of loading things that a user may not actually ever see. You're most likely doing a disservice by trying to be clever about this. Source:http://stackoverflow.com/questions/17244712/afnetworking-prefetch-other-images I hope it would be helpful. But still I am also looking for setting priority for a specific image. SDWebImage does prefetch 1 previous image and next image. I want to give priority to the current image. – Utsav Dusad May 04 '16 at 08:41

0 Answers0