[whatwg] Proposal for separating script downloads and execution

Glenn Maynard glenn at zewt.org
Wed Feb 9 03:14:57 PST 2011


> On Wed, Feb 9, 2011 at 12:08 PM, Alexandre Morgaut
> <Alexandre.Morgaut at 4d.com> wrote:
> > Another approach:
> > The link tag is meant to support a "prefetch" value for the "rel"
attribute
> > asking to preemptively cache the resource:
> >  - http://blog.whatwg.org/the-road-to-html-5-link-relations#rel-prefetch
> >  - http://davidwalsh.name/html5-prefetch
> > We can then write:
> > <link rel="prefetch" type="text/javascript" src="myscript.js">
> > let the link HTML Element have an execute() method when the "type"
attribute
> > is one off a User-Agent supported Scripting Media Types:

Executing scripts out of a <link> seems very strange.

Prefetching can also be disabled by the user, heuristically disabled by the
browser or download at a lower priority.  There's no way to know in advance
whether that will happen--not just due to lack of an API to ask, but because
the browser can't always tell in advance.  Prefetching is a hint, where
script preloading shouldn't be; loaders must be able to know whether they
can load-without-executing or not.

--
Glenn Maynard



More information about the whatwg mailing list