Re:Idle Until Urgent
by AstralStorm on Thursday September 20, 2018 @10:57AM
(#18032885)
Even so, you could backload the drawer etc. placing them at the end of the document and attaching to potentially already rendered page.
Reorder so that your main content loads first.
Author did part of it by deferring the analytics init.
Not sure why they used setTimeout though for the initialization instead of requestIdleTimeout like everything else.
The page is supposed to work without JS after all.
"I mentioned above that requestIdleCallback() doesn’t come with any guarantees that the callback will ever run."
Not true - there's a timeout argument. It guarantees that the callback will by ran by then.
Reorder so that your main content loads first.
Author did part of it by deferring the analytics init. Not sure why they used setTimeout though for the initialization instead of requestIdleTimeout like everything else. The page is supposed to work without JS after all.
"I mentioned above that requestIdleCallback() doesn’t come with any guarantees that the callback will ever run."
Not true - there's a timeout argument. It guarantees that the callback will by ran by then.