voteamerica / voteamerica.github.io

Front end for the Carpool Vote website. Support every American's right to vote!
http://www.carpoolaction.org/
MIT License
38 stars 50 forks source link

reduce download size #302

Closed tristanmkernan closed 6 years ago

tristanmkernan commented 7 years ago

looking into the site's performance, i noticed that the site downloads a few rather large facebook and twitter libraries - but i could not identify where they were used. i think that we can configure the "tweet/share this on x platform" without downloading the javascript libraries!

questions

richardwestenra commented 7 years ago

I believe it's just using these scripts for the share buttons. They're the standard scripts recommended by Twitter/Facebook. I'm sure there's a way to do it without requiring these scripts, I just haven't really looked into it, as I figured the scripts are loaded asynchronously so they're probably not slowing down the rest of the page. Feel free to look into it if you've not got anything more pressing to work on.

tristanmkernan commented 7 years ago

i did some tests and here are the results:

download size

base: 950 KB v2-minus-fb: 775 KB v2-minus-twitter: 925 KB v3-minus-fb-and-twitter: 730 KB

number of requests

base: 80 v2-minus-fb: 75 v2-minus-twitter: 79 v3-minus-fb-and-twitter: 70

questions

richardwestenra commented 7 years ago

Great work, thanks @russon77! I'd be interested to see how these affect page load time (specifically time to interactivity). While I have no doubt that these libs affect total download, they probably don't affect page load time so much because I believe they're async.

@sasjkia why do we have so many analytics tools?

sasjkia commented 7 years ago

@richardwestenra I was unaware of these tools... I know about gosquared because I get email updates on usage stats but I'm not sure who keeps paying for it but it's not me! :D

richardwestenra commented 6 years ago

I've created a dedicated task for removing the twitter/facebook widgets: #337