W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: lazy loading for images via css

From: Felipe Nascimento de Moura <felipenmoura@gmail.com>
Date: Wed, 3 Jul 2013 18:19:41 -0300
Message-ID: <CAJVBkVkaPc1xwhbXpBVmsG+cWhxR2ys9d24vD+-Yvq1uyiyBwg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Yoav Weiss <yoav@yoav.ws>, Simon Sapin <simon.sapin@exyr.org>, Liam Quin <liam@w3.org>, Bjoern Hoehrmann <derhoermi@gmx.net>, www-style <www-style@w3.org>, brice@websailors.fr
On Tue, Jul 2, 2013 at 12:44 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Tue, Jul 2, 2013 at 4:22 AM, Yoav Weiss <yoav@yoav.ws> wrote:
> > A related standard proposal for HTML based resources can be found at
> >
> https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourcePriorities/Overview.html
> >
> > Adding similar capabilities to CSS based resources, and especially
> > background images and fonts (mainly for icon fonts), can be extremely
> useful
> > for similar use-cases.
> >
> > In the Resource Priorities proposal the 'lazyload' attribute is used as a
> > hint rather than a directive, and user agents should treat it as low
> > priority resource (and load it after the other resources), but may load
> it
> > regardless of its visibility (e.g. to avoid waking up the radio on
> mobile at
> > a later phase).
> > The only binding part in the Resource Priorities proposal is that
> 'lazyload'
> > resources don't block the page's onload event.
> > It seems logical to apply similar rules to CSS based resources that are
> > marked for lazy loading.
> Yes, I wouldn't intend it to be anything more than a hint that the
> browser is allowed to load it "later": after all critical resources
> but then otherwise unconstrained (except that they must load when they
> come into view).
> ~TJ
Well, this would be quite useful, no doubt!
But wouldn't it give more power and options to developers if they could
actually say that no image shall be downloaded unless they said so?
I imagine it comparing that idea used by Google and Facebook in which they
load their scripts commented, and only "eval" it when they need, piece by
When it JS was created and allowed developers to get their content as
string/text(and then eval it or not), I bet they never thought it would be
used that way, for those reasons.
I mean, developers will find a way to make it useful in ways we can't
imagine right now, as long as we give them options.

Telling the browser to prioritize or not a load is useful, but it would
also be useful to load the resources in another moment...for example, after
a javascript has validated that the user is using a mobile device, or that
it is under a 3G connection or not.


*Felipe N. Moura*
Senior Web Developer

Website:  http://felipenmoura.org
 Twitter:    @felipenmoura <http://twitter.com/felipenmoura>
LinkedIn: http://goo.gl/qGmq

Meet some of my projects:
BrazilJS Conference <http://braziljs.com.br/>  |  BrazilJS
|  Power Polygon <http://github.com/braziljs/power-polygon>  |
TheWebMind<http://thewebmind.org/>  |
LinuxUser #508332
*Changing  the  world*  is the least I expect from  myself!
Received on Wednesday, 3 July 2013 21:20:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:12 UTC