WordPress is dynamic and so every time a page is rendered it is created on the fly. Systems like Movable Type used to prerender all their pages but with large (more than 1,000 pages) WP site this is impractical.
You can measure speed of download using the Network Tab in Inspect Element of Chrome.
3 seconds + : Performance Emergency, you will lose users
1-3 seconds : Users will be annoyed but most will stick with this suboptimal experience
.5-1 second: May seem a little bit slow but not noticeable
250-500 ms: Good, users engaged
<250 ms: FAST
<100 ms: INSTANT
Mark mentioned that he managed to get his site http://havebabyneedstuff.com/ display in 29 ms.
WordPress Hosting for Performance
- Web Server: Nginx (much better than Apache). Here’s Mark’s Nginx for WordPress set up: https://gist.github.com/markjaquith/04162825d159c8fb5534
- PHP-FPM – use to run PHP on Nginx: http://php-fpm.org/
- Latest version of PHP (5.5 at the time of writing), much faster than previous versions, has a built-in opcode cache.
- HHVM (HipHop Virtual Machine) Alternative to PHP-FPM, project by Facebook. Amazing performance benefits and fully supports WP. Set up site monitoring because still a bit unstable, but can be 4-5 times faster than PHP-FPM
- Caching – Nginx is Mark’s preferred way to cache, see his set up here. HTML output caching is crude, object caching is elegant. WP supports this in core, by default it uses object caching. Mark recommends using redis for caching (Pantheon is the only WP hoster currently using this).Also use the PHP caching functions such as wp_cache_set() to cache. The rule of thumb is to cache any data that’s expensive to build or that talks to remote servers.Here’s Mark library that wraps the WP Transients API (option for soft expiration).
- Measuring – Mark uses New Relic for analyzing why a site/query is slow.
Recommended WordPress Stack
Nginx (with caching)