Reputation: 514
According to the doc, the current prefetch method doesn't consider headers as same as . Does anyone know wether this is going to be fixed when the API is completed?
Upvotes: 10
Views: 512
Reputation: 157
Hope it's not too late, I faced this issue before, and currently the prefetch method still not take any headers.
I found out there's a method in Image class named getSizeWithHeaders, base on the description:
In order to retrieve the image dimensions, the image may first need to be loaded or downloaded, after which it will be cached. This means that in principle you could use this method to preload images
So if you use this method, it did prefetch the Image with headers for you, which fulfill your requirement even it's not optimized.
Looks like this is the only method to solve this, please correct me if there's any optimized method or library.
Upvotes: 2