Last month, Darren Rowse asked me to contribute a post to Problogger about methods to increase page loads. He gets a lot of questions from his community and he wanted someone who had some experience in the area to help out. I obliged.
Please read it.
I wanted to follow up that article with a few page load and other optimization techniques, largely because, as I surf around the internetz, I’m noticing an increasing number of blogs that are very weighed down.
The golden rule here is that if a page takes longer than 2 seconds to load, it’s too heavy. Realistically, you want to shoot for a page load of under a second. In an era where broadband is ubiquitous, there is no excuse.
Images
While I talked about images in the post at Darren’s blog, I really want to hammer this home. Kill the background images. The textured backgrounds, though they look good, are sucking your bandwidth. The same can be said for full-size banner headers. The only image that really should be in your header is a logo and it should be cropped to the size it actually is. Unless there is just some aspect of your branding that has to be fit into a full 750 or 1000px wide header image, you’re wasting your users bandwidth and slowing down your site.
Google Analytics
This is not really a page load issue, but it is a highly valuable point that at the time of writing the Problogger article, I was unaware of. Duncan Riley actually had a fantastic pointer about Google Analytics code that suggested going against the conventional wisdom (and Google recommended) approach of inserting the code in the footer and instead placing it in the head of the page.
Google recommends (and it is standard practice for most tracking code) that the code be placed in the footer as it will end up being the last thing to load, allowing the rest of the page to render and give the appearance of a quicker load. Duncan notes, however, that sometimes readers move on before that Analytics code is loaded preventing a registration of a pageview.
Since reading that article, I moved my GA code to the header and have experienced only a miniscule reduction in load time, but have increased the number of pageview. It’s important to note, though, that the pageviews are not changing, just the perception. If you run ads, it is the perception of pageviews that advertisers are buying ads based on – so you do want this to be perceived closer to the actual pageview number.
WordPress users, reduce your plugins!
Some people love using every plugin under the sun for WordPress. It’s as bad as those people that install every Facebook app around (Love you both, Lorelle and Cathryn!). The end result is slower load time.
This could be for a number of reasons. Plugins don’t necessarily go through the same QA and optimization process as the core WordPress code therefore, the activation of a plugin could introduce inefficient code or load unnecessary PHP processes into memory. Also, plugins that provide configuration options may also expose uncertain conditions when configured in certain way. The Google Sitemaps plugin is a great example of a plugin that, when misconfigured, can cause detrimental effects on a server which directly affects load time.
As always, my recommendation is always to run a tight ship, lean and mean is the best policy, and only use what you actually need. And if you stop using a plugin, make sure you deactivate it. There’s a security aspect to this as well.
Just a few more tips from experience. Feel free to add your own in comments.