W3C home > Mailing lists > Public > public-web-perf@w3.org > September 2013

RE: Comments about lazyload & postpone

From: Jatinder Mann <jmann@microsoft.com>
Date: Sat, 28 Sep 2013 01:22:54 +0000
To: "Podjarny, Guy" <gpodjarn@akamai.com>, "public-web-perf@w3.org" <public-web-perf@w3.org>
Message-ID: <eb24641153774c979c1f278065aecd89@BLUPR03MB065.namprd03.prod.outlook.com>
> I assume lazyload on a link tag won't block rendering either, but it's not explicitly stated.
I have updated the spec to state that User Agents must not block rendering on stylesheets that have the lazyload boolean attribute.
> If a page holds multiple link tags to stylesheets, and some of them have the lazyload attribute, what's the cascading order?
> Is it in the order of appearance in the DOM, or the order in which they were processed (I.e. The lazy loaded ones are last).
> Also, what's the cascading order between multiple lazy loaded stylesheets? This seems to be addressed for links, since
> as soon as ordering is needed, lazyload is ignored.
I would lean towards all non-lazyloaded stylesheets in document order, and then all lazyloaded stylesheets in document order. Would you consider another approach?
> I assume postpone and lazyload objects don't delay DOMContentLoaded either? Is there a requirement to not download a
> lazy-loaded resource until DOMContentLoaded has been fired?
That's correct, neither lazyload or postpone should delay DOMContentLoaded - I have updated the spec to make that clear. I don't have any specific statement that says we shouldn't even bother downloading a lazyloaded resource until after DOMContentLoaded has fired. The developer can state their intention to the User Agent to reduce the download priority, but I don't think we need to specifically state when the User Agent should do the downloading. If the UA feels it should wait longer, the UA can make that optimization on its own.
> What effect can (inline or not lazy-loaded) scripts in a page can have on lazy loaded resources?
> I.e. Can a script interrupt a lazy loaded or postponed download, for instance by hiding it? Would that abort the request?
> What's the effect of a script removing the lazyload or postpone attribute? The answer to some of these may be fairly
> obvious (to me, at least), but I think it'll be good to define these behaviors in the spec.
Most User Agents will kick off the network request for a resource as soon as you specify it in script. E.g., as soon as you specify the src url for an img, the UA will kick off that network request. So if you are specifying lazyload/postpone by script, it's important to set the attributes before you specify the src. Removing the lazyload attribute after the User Agent has already fired off the request will have no impact.
If the User Agent hasn't already started downloading the resource, there may be a use case to change the behavior if script removes the attribute. E.g., you remove the postpone attribute from footer images on your page after five seconds, even if the user doesn't see them, and expect the User Agent to download them right away. Is this the use case you were thinking of? I don't yet have a sense for how common this would be.
Regardless, we will need to specify the expected behavior here, whether removing the attribute has any effect or not.
> I assume this replaces the img defer attribute? (http://lists.w3.org/Archives/Public/public-web-perf/2013Apr/0063.html)

Yes, lazyload and postpone replace the initially proposed 'defer' attribute. As we want lazyload to impact script and script already has a defer attribute, to avoid creating a compatibility issue we have gone with a new name.

Thanks,
Jatinder

From: Podjarny, Guy [mailto:gpodjarn@akamai.com]
Sent: Friday, September 6, 2013 7:05 AM
To: public-web-perf@w3.org
Subject: Comments about lazyload & postpone

All,

I recently read through the "Resource Priorities" draft (https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourcePriorities/Overview.html).
I really like it, and feel like it captures the vast majority of what I'd like to see in such a capability.

I do have a few comments/thoughts on it, though:

  1.  I assume lazyload on a link tag won't block rendering either, but it's not explicitly stated.
  2.  If a page holds multiple link tags to stylesheets, and some of them have the lazyload attribute, what's the cascading order? Is it in the order of appearance in the DOM, or the order in which they were processed (I.e. The lazy loaded ones are last). Also, what's the cascading order between multiple lazy loaded stylesheets? This seems to be addressed for links, since as soon as ordering is needed, lazyload is ignored.
  3.  I assume postpone and lazyload objects don't delay DOMContentLoaded either? Is there a requirement to not download a lazy-loaded resource until DOMContentLoaded has been fired?
  4.  What effect can (inline or not lazy-loaded) scripts in a page can have on lazy loaded resources? I.e. Can a script interrupt a lazy loaded or postponed download, for instance by hiding it? Would that abort the request? What's the effect of a script removing the lazyload or postpone attribute? The answer to some of these may be fairly obvious (to me, at least), but I think it'll be good to define these behaviors in the spec.
  5.  I assume this replaces the img defer attribute? (http://lists.w3.org/Archives/Public/public-web-perf/2013Apr/0063.html)
Cheers,
Guypo

--
Guy Podjarny | CTO, Web Experience, Akamai
Received on Saturday, 28 September 2013 01:23:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:01:21 UTC