Search code examples
phphtmlperformanceshare-button

Social buttons performance


I have performance issues with my gallery once i added social buttons.

The gallery currently has around 30 thumbnails, for each there are four social buttons for various service (fb,g+,twitter,pinterest).

But my pageload jumped up to thirty or more seconds rendering the page useless.

My question is : Can i somehow adjust the plugins so they load faster ? Should i maybe change my approach and display these "on demand" ? Or maybe should i divide the gallery into more pages so there is not so many of these at the same time ?


Solution

  • Since the images are hosted on the social networks servers you are making a request to their server each time to get the image. 4 images per thumbnail would be 120 requests which can add alot to the response time of your page.

    I would suggest you host the images on your own server (maybe as a spritesheet) to reduce the amount of requests.