Just shaved 3-5 seconds off my page load time
So recently I and others looking at one of my physical product affiliate sites noticed that it was really slow just waiting for the server response once a link was clicked.
We're talking click link..... wait... wait.... wait up to 5 seconds... then finally the url changes.... and then another 2-3 seconds go by and FINALLY the page loads!
There's no way anyone's going to stay on the site long with that sort of thing happening!
So I set off to figure out how to speed things up - long story short, it ended up being that the social scripts I was loading (Facebook, Twitter, G+, and Pinterest) were all blocking and taking a lot of time to download, and the way the site is designed, those resources had to all be in place before the page would render.
I decided to try taking them out, and whoa, my page load time went from 3-5 seconds down to about 1-2! Now, that's not to say I might not add them back in at some point, but honestly right now, I don't care too much if people hit the social buttons for the stuff on my site at the moment because a lot of it is just catalog product links that link back to the merchant site.
However, it could just have easily been some other script loading an external resource.
Moral of the story - if it seems like your site is slow, first check it out with http://www.webpagetest.org/ - and then once the test completes, look to see if there's a long green bar for the first resource that loads (in the waterfall view - will make sense once you see it). That's called "Time to First Byte", and if it's really long & slow (like mine was), it may be an indication that you're loading too many external resources/javascripts up front and need to either find a way to load them in a different order, or perhaps not use as many.
Join FREE & Launch Your Business!
Exclusive Bonus - Offer Ends at Midnight Today
00
Hours
:
00
Minutes
:
00
Seconds
2,000 AI Credits Worth $10 USD
Build a Logo + Website That Attracts Customers
400 Credits
Discover Hot Niches with AI Market Research
100 Credits
Create SEO Content That Ranks & Converts
800 Credits
Find Affiliate Offers Up to $500/Sale
10 Credits
Access a Community of 2.9M+ Members
Recent Comments
15
Yeah, I had the site precached and minified both with Cloudflare and with W3 Total Cache. I think in this case the issue is that either WP or Cloudflare won't cache external javascript assets loaded from 3rd party sites (probably because all the 3rd party sites have to check their database to see how many 'likes', 'pins', etc your page has on-demand).
I've found Cloudflare to be very useful in both improving site security and improving speed (since it mirrors your site at data centres around the world). Don't know if you use it, but since it's free, it's worth the time required to set your site up with it :-)
Yeah! I actually do use Cloudflare and have found it pretty helpful. Ironically in this case, since the scripts I was using were pretty small but just required 3rd party server responses (Facebook, Google, Pinterest, Twitter) to proceed, Cloudflare didn't actually affect it much. It's nice to have it working along side me!
Scripts are generally best off loaded last, so in Wordpress that would mean they are located in the footer. Most good themes like Thesis for example will have a section for scripts and they load them last.
Definitely. In this case, I had actually just pasted the scripts inline where the buttons needed to show up on the page - which apparently was quite not the right spot to put them!
Most of the time pages load times are noticeably affected by external scripts like the social buttons. FB, TW, G+, these all contribute to a slower page load time. As you mentioned, there are a lot of other kinds of scripts too that can just kill your page load time. WordPress is the worlds most used website builder and we love it because of it's flexibility and ease of use. However, PLUGINS are the WordPress killer. Most people think that plugins are going to offer something that will make their site "awesome", well I've seen 1000's of sites at WA hosting get ruined by plugins. Page load times upwards of 5-10 seconds, errors on the page, and HACKING attempts.. Many plugins are gateways to getting hacked. Hackers mostly use your domain to spam people and in the process it can just kill your page load time.
Many plugins for Wordpress actually contact external servers on EVERY page load and this will ruin your visitor's experience as you site wil be slow and slugish.
To make a long story short (I could rant about this forever), external scripts, plugins, and so called "Site enhancers" can cause more harm than good. If you've got a slow site, the first thing to look at is your plugins, or external scripts.
It's true! I've also noticed (and edited out) additional unnecessary Wordpress/theme SQL query requests as well - some of these can be added by a template and can definitely slow down a page load, especially if the query is large or the database is not well optimized.
There's pretty much 2 things that make a good website:
1. Good content
2. Fast Load
Anything else is detracting from the experience.
See more comments
Join FREE & Launch Your Business!
Exclusive Bonus - Offer Ends at Midnight Today
00
Hours
:
00
Minutes
:
00
Seconds
2,000 AI Credits Worth $10 USD
Build a Logo + Website That Attracts Customers
400 Credits
Discover Hot Niches with AI Market Research
100 Credits
Create SEO Content That Ranks & Converts
800 Credits
Find Affiliate Offers Up to $500/Sale
10 Credits
Access a Community of 2.9M+ Members
Thank you for tell us