I was particularly interested in attending the WordPress Optimization session presented by Ben Metcalfe of WP Engine during WordCamp Philly. Considering that most of our end-users are on shared hosting and not well-versed on technical jargon, it’s common to receive questions on the support forums related to slow sites / servers / and optimization tips.
Ben provided a list of to-dos for WordPress optimization. Some are a bit technical and you may need a server admin to perform them, however others are do-able right from within WordPress. If I find a link to Ben’s presentation online, I’ll be sure to link directly to it. For now, here’s the quick list to consider depending on your setup and circumstances:
For all users
For Advanced Users and High Traffic Sites
- Log Slow MySQL Queries – check your logs! What’s taking the most time? Dig into it.
- Check Site with Profile Tools– use any of the tools below to dig into your site’s performance.
- CDN – Use a CDN. It can be used all the time – OR – just in “emergencies.”
- Smush Images – Let’s face it – you don’t sit there and optimize every image before uploading it to your site. The plugin below will do it for you.
- APC / Opcode cache – PHP-APC + W3-Total-Cache
Apache Optimization – your server admin should be able to optimize your Apache server. When possible, disable .htaccess and use httpd.conf instead (central library that Apache uses).
Do NOT attempt this unless you know what you are doing! It is not for beginners.
- Dedicated MySQLDB Box – Consider moving your MySQLDB Box to another server in the same data center.
- Reverse-proxy with nginx – Run Apache on port 8080. Cache static pages.
- Varnish Cache – Ideally, do not run Varnish on port 80 (even though some tutorials tell you to do so on port 80). Varnish cache doesn’t like cookies. Send cookies to nginx.
Update – Jake’s Comment: Varnish VCL should be configured to destroy cookies when unnecessary (not logged) and to destroy cookie of static content.
- Memcache – Ideally, run Memcache on a separate box in the same datacenter under the same subnet.
- HyperDB – multiple database servers – not intended for the standard user.
- Static Site on Amazon S3 – If you can generate your site as static pages, Amazon can host them. Do not do this if your site requires any dynamic widgets or data processing.
Finally, here’s something that should be reinforced by everyone, do not edit WordPress core files. It’s not good practice and will be overwritten when you upgrade your WP installation.
Now, go optimize your site!