WordPress Performance Optimization: May 2014 meetup
We talked about WordPress Performance Optimization at our May 15, 2014 meetup: testing, hosting, caching, CDNs, image optimization, queries, transients, and more. Get ready! WordCamp Grand Rapids 2014 is August 15-16! Remember, you can also find us on Meetup, Twitter (@wpgrandrapids and #wpgr), and Google Groups. If I missed anything in the notes below, please leave a comment, and I’ll add to the post.
Testing, hosting, caching, CDNs, image optimization
- BrowserDiet: front-end performance guide
Managed WP hosting
Note: this section contains hosting affiliate links.
- The host is often the main determinant of performance
- Use a host that’s optimized for WordPress
- SiteGround: fast, secure WordPress hosting
- SiteGround is an excellent WordPress-optimized shared host. They’re fast, secure, and reliable, yet inexpensive. They’re the host I most frequently recommend to small business and nonprofit clients. From firsthand experience, I’ve found their plans to be superior to similar hosting plans from GoDaddy, Bluehost, DreamHost, Hostmonster, HostGator, iPage, and small local hosting companies.
- WordPress Hosting
- For clients with larger and/or higher-traffic sites, or who need additional benefits, we recommend WP Engine, but for most smaller sites, SiteGround provides great features for relatively low cost.
- Use managed WordPress hosting; they often handle caching. Even if you’re not using managed WordPress hosting, use the host’s caching as much as possible.
- WP Super Cache: simpler, less problematic than W3 Total Cache
- W3 Total Cache: more powerful but more problematic than WP Super Cache
- Resize, then compress
- OS X: Preview, ImageOptim
- Windows: Paint.NET, RIOT
- WordPress: Imsanity (Imsanity plugin automatically resizes, compresses images)
- Helpful Tools to Optimize Images for the Web
Caching, queries, transients
W3 Total Cache
- Turn on all caches
- Enable Page Cache
- For e-commerce, don’t cache cart, checkout, my account pages
- Queries are controlled by query.php in core
- Queries use WP_Query class
- Look at query.php and see all the filters available. You may not want to write a custom query; you may be able to modify the main query with pre_get_posts(). It’s more efficient to modify the main query that WordPress is already running than to add a new query. Be very specific about when you’re going to modify the main query; use conditionals.
- Querying the database is slow. Use transients to cache data.
- Check if data is already cached with get_transient()
- If it isn’t cached, store with set_transient()
- return maybe_unserialize
- Empty data from cache with delete_transient. Set when this should happen.
- Host is first line of performance. Also likes SiteGround for performance and great customer service.
- Why we don’t use a CDN: A story about SPDY and SSL
- How Basecamp Next got to be so damn fast without using much client-side UI
WordPress development tools
- Debug Bar
- P3 (Plugin Performance Profiler)
- WordPress won’t show cached content while you’re logged in
- Use Incognito mode (or another browser)
- Query Monitor
For image optimization there’s a new online tool: http://optimizilla.com