Skip to main content
 

Heads up webmasters -- please consider updating your javascript snippets.

Heads up webmasters -- please consider updating your javascript snippets.

Originally shared by Ilya Grigorik

All Google+ widgets have been updated to use the script[async + defer] pattern! E.g. +1 button docs: http://bit.ly/YHoj96

What's the benefit? Loading widgets via script[async+defer] does not block the document parser (see [1]), and allows the preload scanner to discover the script resource and initiate an earlier fetch (see [2]). Net outcome, both your page and the widget load faster! Have a G+ widget on your page? Check out the docs for guidance on how to update your snippets.

Kudos to the G+ team for taking the lead on this! Hope to see more widget providers adopt the same pattern.

[1] https://developers.google.com/web/fundamentals/performance/critical-rendering-path/adding-interactiv...

[2] https://www.igvita.com/2014/05/20/script-injected-async-scripts-considered-harmful/