3 ms·
Source for your second paragraph: https://news.ycombinator.com/item?id=16730905 https://news.ycombinator.com/item?id=16730905 That's out of date now, though; d
by wizzwizz4 7y ago
Source for your second paragraph: https://news.ycombinator.com/item?id=16730905 https://news.ycombinator.com/item?id=16730905
That's out of date now, though; despite still being part of the required boilerplate CSS for AMP pages, I can't find that delay in any of the https://amp.dev/ https://amp.dev/ pages (the ampbyexample.com replacement demo site).
This is really shady.
- joshuamorton 7y agoIt's a little more complex than that: If you disable all js, there is no delay. If you specifically block amp js, there is a delay. There could certainly be a shady reason for this, but the justification makes sense: one of the goals of AMP is to have, basically, a single, correct, initial paint. That's why images are statically sized and amp sticks placeholders there until the real images load. The js delay exists to allow the site to fetch the js and use it to correctly render the initial paint, even on a slow/flaky connection where the js takes a bit to fetch.
- deleted 7y ago[deleted]
- stephenr 7y agoThe delay is css based not js based, so why would blocking all js affect it?
- wolfgang42 7y agoIf you tell the browser to disable execution of all <script> tags, it will instead evaluate the <noscript> tag which contains some additional CSS that disables the animation.
- stephenr 7y agoAh, I didn't realise/remember it has a noscript block, it's been a while since I dug into the issue originally.
- gregable 7y agoSites which optimize their pages via https://www.npmjs.com/package/@ampproject/toolbox-optimizer https://www.npmjs.com/package/@ampproject/toolbox-optimizer have the initial layout performed server-side instead of by javascript, and thus the CSS Flash-of-unstyled-content protection is removed. amp.dev runs this optimization, along with lots of other sites.