On May 10, 2012, at 7:26 AM, Boris Zbarsky <bzbar...@mit.edu> wrote:

> On 5/10/12 10:19 AM, Mathew Marquis wrote:
>> Hey guys. Don’t know if it’s too early to chime in with this, but we were 
>> told by some members of the Chrome team that any browser that supports DNS 
>> prefetching — including assets — wouldn’t consider “looking-ahead” on the 
>> img tag as an option.
> 
> Why not?  In any case, _DNS_ prefetching would be the same for both the 
> low-res and high-res image, I would think.
> 
>> The original src would be fetched in any case, saddling users with a 
>> redundant download.
> 
> That sounds like image prefetching, not DNS prefetching.  I see no obvious 
> reason it couldn't look at multiple attributes.


Indeed. I'm reasonably familiar with WebKit's preloading code and I see no 
reason it couldn't look at the srcset attribute. This would work fine for scale 
factor selection. Unfortunately, it would not work for the suggestion to have 
srcset pick images to fit available space based on width and height. Available 
space is not known until layout time, which happens too late for preloading 
decisions. So width/height fitting would defeat prefetch, regardless of 
specific syntax used.

Perhaps this is what the Chrome engineers were thinking of; hard to say without 
more detail.

Regards,
Maciej

Reply via email to