Answer the question
In order to leave comments, you need to log in
Social Plugins. Who knows how to deal with them?
I go to the main page of our news portal.
+350 ms waiting and the html page loaded.
+100 ms - css
then a sea of blocking requests from G+, FB plugins pours in, the scripts
of which begin to pull a sea of pictures and requests to even more
scripts.
Ours: html, css, 25 pictures, the loading of which was delayed by social scripts
for all 1500 ms. Downloading the pictures themselves is measured in 20-60 ms
each + server delay - 15 ms.
Total - 89 requests 924.8 Kb, loading 3930 ms, of which 780 Kb -
social networks and their content, competing with the main pictures, all
this dragged out the process for 2500 ms extra time, which is critical.
What, besides moving scripts to the tail of the page, can be done
to increase the speed of return of the main one, leaving the loading of social slag
for later?
upd: on the advice of the public
habr.ru/post/148213/
habr.ru/post/105850/
habr.ru/post/136360/
habr.ru/post/49245/
Answer the question
In order to leave comments, you need to log in
Make lazy loading
An easy option, for example, for G + Google offers by default
You can call the function on onload or even on a timer after onload
Oh, and also, google for "asynchronous loading". See how this is done, for example, at rbc.ru if you open any news, at the end of the page source code. All these social buttons are dynamically loaded at the end and rendered dynamically on the page.
some external scripts can sometimes (and should) be downloaded from your site (stupidly copied to your host and downloaded from there).
There was a post on Habré about one of the ways to asynchronously download files. The author shares his solution.
If such a thing as Page Speed from Google has not yet been installed, then I recommend installing it.
Badoo on HPC was told that they load a regular image depicting a like, and then load a widget when necessary
If you have Opera, you can look at the requests in the debugger and add userapi.com, and similar sites to the blacklist. They pull a bunch of scripts. create iframes, while, for example, I never used these likes and buttons.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question