W3C home > Mailing lists > Public > public-respimg@w3.org > September 2014

Re: Title of the spec may cause heartache

From: Podjarny, Guy <gpodjarn@akamai.com>
Date: Tue, 23 Sep 2014 10:54:55 -0500
To: Yoav Weiss <yoav@yoav.ws>, Bruce Lawson <brucel@opera.com>
CC: Attiks <attiks@gmail.com>, John Albin Wilkins <john@albin.net>, Christopher Schmitt <schmitt@christopher.org>, Jason Grigsby <jason@cloudfour.com>, Odin Hørthe Omdal <odinho@opera.com>, "public-respimg@w3.org" <public-respimg@w3.org>
Message-ID: <D047538F.2A0C9%gpodjarn@akamai.com>
All,

Could this double-download be mitigated by wrapping the <img> tag with <noscript>?

Something like this:
<img srcset=“book.jpg 1x, book-HD.jpg 2x”>
<noscript>
<img src=“book-default.jpg”>
</noscript>

Seems to me like:

 *   If JS is enabled, no browser will preload book-default.jpg (I haven’t tested it, but it’s hard to believe this isn’t the case)
 *   On old browsers (that don’t support srcset)
    *   If JS is enabled, the polyfill will make the srcset attribute work, and can delete the <noscript> element if desired
    *   If JS is disabled, book-default.jpg will be loaded (and perhaps even preloaded)
 *   On new browsers (that support <picture>)
    *   If JS is enabled, they’ll simply use the srcset attribute
    *   If JS is disabled, they’ll break

In other words, you’re trading double-downloading on all non-picture browsers (which for a good while will include, for example, the vast majority of mobile traffic) for broken pages on new browsers with JS disabled.

My apologies if I’m missing something obvious or am making a wrong core assumption here.

Cheers,
Guypo

--
Guy Podjarny | Akamai CTO, Web | www.guypo.com<http://www.guypo.com/> | @guypod<http://twitter.com/guypod/>

From: Yoav Weiss <yoav@yoav.ws<mailto:yoav@yoav.ws>>
Date: Tuesday, September 23, 2014 at 11:33 AM
To: Bruce Lawson <brucel@opera.com<mailto:brucel@opera.com>>
Cc: Attiks <attiks@gmail.com<mailto:attiks@gmail.com>>, John Albin Wilkins <john@albin.net<mailto:john@albin.net>>, Christopher Schmitt <schmitt@christopher.org<mailto:schmitt@christopher.org>>, Jason Grigsby <jason@cloudfour..com<mailto:jason@cloudfour.com>>, Odin Hørthe Omdal <odinho@opera.com<mailto:odinho@opera.com>>, "public-respimg@w3.org<mailto:public-respimg@w3.org>" <public-respimg@w3.org<mailto:public-respimg@w3.org>>
Subject: Re: Title of the spec may cause heartache
Resent-From: <public-respimg@w3.org<mailto:public-respimg@w3.org>>
Resent-Date: Tuesday, September 23, 2014 at 11:34 AM

@attiks - if you use <img src> with an old browser, you'd have a double download, regardless of using <picture> or srcset, if you're using picturefill..
so, if you are using a polyfill, and want to avoid the double download, just omit the src attribute in either case.

In any case, that's irrelevant to the "picture or srcset" question.

On Tue, Sep 23, 2014 at 7:24 AM, Bruce Lawson <brucel@opera.com<mailto:brucel@opera.com>> wrote:
On 23 September 2014 13:51, Attiks <attiks@gmail.com<mailto:attiks@gmail.com>> wrote:
> We're using picturefill that adds support for srcset as well, so you'll get
> both.

ah, well, I didn't know that. That's nothing to do with new responsive
images in browsers, though.

bruce
Received on Tuesday, 23 September 2014 15:57:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:06:12 UTC