Photo by By Éole
Why obsess with site speed?
Site speed has been used as a signal for rankings since 2010. There are lots of benefits of having a blazing fast site:
- Better user experience
- People spend longer time on your site if it loads fast
- Search engines can crawl your site faster
WordPress Page Speed Check List
Hosting is one of the most important elements of WordPress performance and page speed optimization. You don’t want to run your site on a shared hosting service, because your page speed will suffer. Shared hosting is usually cheap, slow and not optimized for WordPress. I use WP Engine, the premium managed WordPress-only hosting company because they run on advanced custom-built technology for WordPress. You just can’t set up that kind of awesomeness yourself for $29/mo. They offer amazing speed, great support, security, backup and CDN if needed. I never have to worry about my hosting, it’s taken care of. Remember to select a hosting solution that is close to your target audience. If you host in Japan and target California you will get much slower load time then if you hosted in California. Proximity to the web server has a huge impact on load time.
Content Delivery Network (CDN)
Static files take up a large part of the page load, by moving the static files to a CDN they will be distributed to multiple servers on different locations. The user will get served the static files from the servers closest to the selected server. By using a CDN your visitors will get faster load time and you free up resources on your main server. W3 Total Cache works with lots of CDN services like Amazon CloudFront.
Using a jQuery cdn has many of the same benefits as mentioned above. If you use jQuery hosted on Google CDN there is a big chance most of your visitors already have the file cached in their browser so they don’t have to download it again for your site. Here is a list of CDN hosted jQuery.
Avoid bad plugins
Bad plugins can slow down your site. If you feel this the issue try disabling all plugins and see if that helps. You can also you a Plugin Performance Profiler like P3.
Delete unused plugins
Dont let unused plugins slow down you site. Delete them.
Install a cache plugin
This is probably the most important one of all. I highly recommend that you install a cache plugin like W3 Total Cache. Here is a useful starter guide.
Enable browser caching
Makes the browser load files from local disk instead of downloading previously downloaded files. Look for this option in your cache plugin.
Compress images to reduce file size. Many lossless options available. I like WPsmushit.
Image css sprites
To reduce the number of image requests you should combine all your theme images with images sprites.
Minify code (CSS, JS, HTML)
By minifying code you eliminate unnecessary bytes like spaces, breaks and indentation. This can be done with W3 Total Cache and other plugins.
Combine CSS & JS files
By combining your CSS files into one and JS files into one you will significantly save HTTP requests. This can be done with W3 Total Cache and other plugins.
Remove unused code
This saves bytes and minimizes bandwidth use.
Minimize DNS lookups
Minimizing DNS lookups will reduce the number of DNS lookups the browser has to make.
Use Asynchronous resources
With a traditional script the browser has to download and run the script before rendering the HTML that comes after. When using an Asynchronous script the can browser can continue rendering HTML after the script without the wait. The newest version of the Google Analytics script is asynchronous.
My journey to faster page speed – EdgySEO.com case study
Starting out with MediaTemple hosting
When I started this blog I was told MediaTemple was a great web host so I started with their Grid-Service for $20 a month. I tried to set up W3 Total cache. The current server did not allow some of the better cache options and I was not happy with the results, as I was experiencing slow load times.
Then I found CloudFlare
CloudFlare is a brilliant idea. They have their own CDN and protects your site from attacks. In theory it sounded genius, but I still wasnt happy with the load time.
Ended up with WPengine hosting and Amazon CloudFront CDN
As I was paying for VaultPress, CloudFlare and MediaTemple I figured switching to WPengine would save money and I had heard good things about their setup. After moving to WPengine I saw great results in load time and much faster crawl speed.
Average response time went down
The time Google spends downloading a page went down big time
And I got a decent Google PageSpeed Score of 93 (out of 100).
I still have lots of room for improvement, but at some point you have to consider the cost / benefit. For now it’s fast enough. The next step would be to set up my own server with NGINX and spend weeks tweaking it.
7 pro tips from WordPress expert Ryan Hellyer
I am not a code poet, so I asked my colleague Ryan Hellyer from Metronet if he had some pro tips on WordPress speed optimization. Here are his answers:
- Track your database queries. People rarely do this, then wonder why their site runs slow. Some plugins can balloon your database queries through the roof. WordPress menus can also balloon them through the roof.
- If you are not able to use static caching and require WordPress menus, or make extensive use of widgets, then make sure you use the built-in WordPress caching system to take advantage of this. If you are on shared hosting, make sure you use the transients API as the caching API will only work if you have opcode caching running.
- Use opcode caching. It’s ridiculously easy to set up and gives immediate and reasonably large increases in performance. This is generally not possible in shared hosting environments so you typically need your own VPS or dedicated box for this.
- If possible, use a server-side caching system such as Varnish or the one built into NGINX. The speed benefits from this are enormous.
- If you don’t need functionality, remove it. Halving the number of posts displayed on your home page can have an enormous effect on the load time of your home page due to it plummeting the number of database queries.
- Turn on WP_DEBUG to make sure that your site isn’t spitting out lots of errors. Those errors, although minor, can cause a performance problem. I’m not sure how much of an effect the errors may have, I suspect it’s not a lot but I’ve never bothered testing it to find out … I just fix the bugs instead Many poorly coded plugins throw enormous numbers of errors out when you turn the debugger on.
- Don’t use Apache. NGINX is significantly faster.
Awesome resources for WordPress optimization
WP engine – That’s what I use, and it’s the best.
- WordPress optimization guide by Vladimir Prelovac
- Optimizing WordPress slides by Ben Metcalfe
- Performance Optimization and Scaling slides by Matt Martz
- Page Speed Score of 100/100 with WordPress by Kaspars Dambis
- W3 Total Cache – Improve site performance and user experience via caching: browser, page, object, database, minify and content delivery network support.
- WP Smush.it – Reduce image file sizes and improve performance.
- JS & CSS Script Optimizer – Combine JS and CSS, minify and more usefull stuff.
Recommended tools and services
- Pingdom – Monitor the uptime and response time of your websites.
- Pingdom tools – Awesome free tool for testing page load time.
- Google Page Speed Test – Analyzes a web page, then generates suggestions to make that page faster.
- WebPageTest.org – Test website performance.
- Chrome, network tab – Lets you inspect resources that are downloaded over the network
Want to learn more? Check out WordCamps and meetups
More? Feel free to suggest great resources and tips.