

Manipulate the DOM before any resources have loaded using Capturing - shawnjan8
https://hacks.mozilla.org/2013/03/capturing-improving-performance-of-the-adaptive-web/?utm_source=blog&utm_medium=hackernews&utm_campaign=capturing

======
pornel
Sadly it's not a native API, but a clever hack that effectively comments-out
source of the page with a legacy `<plaintext>` element (proving that old cruft
is _really_ hard to kill in HTML :)

~~~
fzzzy
Some of my coworkers made a firefox os app installation page that had both
<marquee> and <blink>. At first I thought they were doing some crazy css
animation thing to get scrolling, flashing text on the phone. Nope, just
marquee and blink.

------
cbr
Adding a blocking javascript resource that disables speculative resources
loading is going to speed up pageloads?

~~~
WickyNilliams
I had the same thoughts. You may be able to reduce bandwidth if you're doing
something like responsive images (even then, over a mobile connection, I'd
rather low-res images be sent to phone despite the pixel density of my
screen), but at the expense of taking longer to start rendering. There's
probably a sweet spot between time to render and page weight, but I think this
probably makes things worse. I'd rather _see things load slowly_ than double
parse the document and see nothing but a blank web page (which i might
interpret as the site being completely unresponsive).

Perceived load time is often as important as actual load time. A site that
takes 10 seconds to load but spend 80% of that is showing a white screen may
_feel_ slower than a website that takes 15 seconds to load but only 10% of the
time is white screen.

~~~
shawnjan8
Hundreds of websites use Mobify.js today, and the feedback we get has always
been the same - how do you make it so fast?! I completely agree about
perceived load time - it is just as important to consider as actual load time,
and if Capturing caused a 10 second white screen, then the technology would be
not very useful. Luckily, Capturing is very quick, and with the speed of
mobile devices greatly outpacing the speed of networks, Capturing becomes even
more useful. Plus after the first load, every subsequent page is EXTREMELY
fast, due to the library cached and optimized by the JIT.

Of course, if you find that the initial white screen is taking longer then you
would like, you could easily render out your logo and background color before
capturing the document to improve perceived load time :)

~~~
WickyNilliams
Thanks for the response. I will look into this as it's something I am
interested in. Can you give me an example of a site using it? So i can get a
feel for what's possible

------
daleharvey
I didnt know this was a thing, wouldnt this be a really nice place to be doing
l10n?

------
stopcyring
or you know, you can use some inline scripts, brand new lib coming out next
week i guess.

