Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One optimization I do often - don't load the FB scripts until someone actually hovers over an FB like button or share box. 99.9% of the time, they never do. In the meantime, just mock the look of the button. We even mocked the like counts et al by polling FB's API from teh server.


Related: Heise's Shariff JS. https://github.com/heiseonline/shariff


Of course, there is no hover on mobile, so you are probably optimizing traffic where it is not so critical.


What if they click the button before the script loads?


If the buttons are rendered on the client, they won't show up at all before the script loads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: