RE: [Resource Hints] Negative Hints

Philip,

  I agree, checking document.visibilityState for 'prerender' addresses JavaScript based no-prerender scenarios.  Checking for 'hidden' is a mostly functional equivalent.

  However, using document.visibilityState puts the onus on the script author rather than the web site owner – and these two mightn’t be one and the same.  Additionally, having prerender control exclusively available in JavaScript promotes the use of JavaScript over HTML, even when HTML might otherwise be a better option.

/brendan.

From: Philip Tellis [mailto:ptellis@soasta.com]
Sent: Monday, April 24, 2017 1:17 PM
To: Brendan Riordan-Butterworth <brendan@iabtechlab.com>
Cc: public-web-perf@w3.org
Subject: Re: [Resource Hints] Negative Hints

If these resource requests are initiated from JavaScript, then that JavaScript should just use document.visibilityState to determine if the beacons or ad iframes should be requested or not.  This is what boomerang has been doing for several years to good effect.

On Mon, Apr 24, 2017 at 12:52 PM, Brendan Riordan-Butterworth <brendan@iabtechlab.com<mailto:brendan@iabtechlab.com>> wrote:
Resource hints present a thoughtful and balanced means for web sites to inform web clients about opportunities to speed presentation of resources to the user.  However, when directing a web client to prefetch or prerender a resource with sub-resources (like scripts or images on an HTML page), there’s no obvious method of excluding some of these sub-resources from being prefetched or prerendered.

It’s my opinion, as an expert in the digital advertising supply chain technology, that some sub-resources shouldn’t be prefetched or prerendered.  Resources that should not be prefetched include most if not all static images that are web beacons, and some advertising iframes.  Resources that should not be prerendered include a wide range of time-sensitive advertising and web-analytics related scripts.

Motivated by Firefox’s move to enable predictive prefetch<https://www.fxsitecompat.com/en-CA/docs/2017/predictive-prefetch-makes-duplicate-http-requests-in-iframes-causing-false-ad-impressions/>, the ad industry is looking for a means to identify links to sub-resources that should not be requested while the parent resource is in the prefetch or prerender context.

I suggest that two additional resource hints be defined to allow sub-resources that should not be requested while in the prefetch and prerender contexts: no-prefetch and no-prerender.  Suggested text appears at the end of this message.

The ability to exclude sub-elements from a prefetch or prerender increases the opportunities for a web site to suggest a prefetch or prerender.  It also heads off the need to develop more complex scripting by ad and analytics systems to detect and handle an early (and, potentially, false) impressions.

Rough suggested text:

2.5 No-Prefetch

The no-prefetch link relation type is used to identify a resource that should not be fetched as a part of a resource that is being prefetched or prerendered.

EXAMPLE 5
<link rel="no-prefetch" href="//example.com/timesensitivebeacon.gif<http://example.com/timesensitivebeacon.gif>">

The user agent should not fetch resources identified as no-prefetch until the next navigation has shown actual need for the resource.

2.6 No-Prerender

The no-prerender link relation type is used to identify a resource that should not be fetched and executed as a part of a resource that is being prerendered.

EXAMPLE 6
<link rel="no-prerender" href="//example.com/analytics.js<http://example.com/analytics.js>">

The user agent may prefetch the resource but should not execute it.

/brendan.

Brendan Riordan-Butterworth
Senior Director, Technical Standards
IAB Tech Lab
(212) 609-3734<tel:(212)%20609-3734>
brendan@iabtechlab.com<mailto:brendan@iabtechlab.com>



--

Received on Monday, 24 April 2017 18:01:02 UTC