D
D
Daniel Newman2012-08-12 10:19:40
Social media
Daniel Newman, 2012-08-12 10:19:40

Social Plugins. Who knows how to deal with them?

843a4d14bfddd53cfb60cd9ccf8c9be9.pngI 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?
d57fb12c55e2d30f24daea14d10e9d88.png
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

8 answer(s)
W
Wott, 2012-08-12
@danielnewman

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

C
charliez, 2012-08-12
@charliez

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.

C
charliez, 2012-08-12
@charliez

some external scripts can sometimes (and should) be downloaded from your site (stupidly copied to your host and downloaded from there).

M
Maxim Ivanushchik, 2012-08-12
@makis

There was a post on Habré about one of the ways to asynchronously download files. The author shares his solution.

A
Alexey Sundukov, 2012-08-12
@alekciy

If such a thing as Page Speed ​​​​from Google has not yet been installed, then I recommend installing it.

D
Dzen_Marketing, 2012-08-12
@Dzen_Marketing

Badoo on HPC was told that they load a regular image depicting a like, and then load a widget when necessary

E
egorinsk, 2012-08-12
@egorinsk

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.

M
Mikhail Osher, 2012-08-13
@miraage

I may be late, but I load all plugins with async=true

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question