High-Performance WordPress Hosting with NGINX Reverse-Proxy Caching
Why Use Caching?
WordPress dynamically generates all the content that makes up a web page every single time that page receives a visitor. By default, WordPress completely regenerates a web page for every single person that visits that page. That means that complex or content-rich WordPress websites can require significant time and resources to generate each page for each visitor. That leads to a slower loading experience for website visitors. High-traffic WordPress websites can even exhaust the resources of their hosting servers, leading to account suspensions or unresponsive servers.
Caching significantly reduces the resource usage and work WordPress has to do to generate web pages. With caching, WordPress generates a web page once for the first visitor, and all later visitors see the saved copy of the web page. That means significantly improved load times versus a site with WordPress regenerating the page for every single visitor. WordPress websites using caching can serve significantly greater numbers of visitors and produce page loads with much faster response times.
The Benefits of Full-Page Caching with NGINX
Caching with NGINX, in particular, has shown great improvement in the performance of WordPress sites. In performance testing with an average WordPress website, a standard WordPress site could only handle home page views at 10 requests per second. As traffic increased, the error rate for WordPress increased significantly. The Apache web server became unresponsive relatively quickly as traffic to the home page grew. The hosting server’s resource usage also grew to the point where Apache had to stop to prevent the hosting server from becoming unresponsive.
With only a 30 second cache refresh time for NGINX, the WordPress website’s home page served 3645 requests per second with less than 1% of those requests resulting in an error. The hosting server also used a mere 1% of the resources of the Apache-only configuration when serving this traffic with NGINX reverse-proxy caching. At the peak of activity, NGINX served 1336 connections with only 7 connections going to Apache. The performance test showed NGINX ably served WordPress for all of the connections with only an occasional trip to Apache to refresh the cached content.
In addition to serving a higher volume of traffic more efficiently, WordPress websites using NGINX reverse-proxy caching also have much better load times. On average, the WordPress website used in performance testing loaded pages in one-third the time it took without NGINX reverse-proxy caching. That means even WordPress websites without extremely high amounts of traffic can benefit from NGINX thanks to its improving page load time. Faster load times can improve conversions for transactional pages, lead to better visitor engagement, and increase a site’s ranking in search results.
Despite the many benefits of full-page caching, a word of caution: not all websites will cache equally well or function properly when caching. E-commerce applications, or applications with large amounts of dynamic content (e.g. comments, real-time data streams, or frequent updates), may require additional configuration to achieve significant benefits from caching. In some cases, caching can also prevent these kinds of dynamic websites from functioning properly or displaying the correct content to website visitors. For example, site owners should never enable full-page caching for the parts of their websites that require logins. Enabling caching on login pages could allow site visitors to see other users’ personal information or data. Despite these limitations, with a little advanced configuration, site owners can achieve solid performance gains with NGINX reverse-proxy caching.
Configuring Full Page Caching with NGINX
Although caching with NGINX has many benefits, configuring NGINX can prove relatively complex. NGINX could fail to load properly if misconfigured. NGINX’s website has an excellent NGINX beginner's guide that covers the basics. However, site owners should always consult an NGINX expert when attempting to setup NGINX, or use a hosting package with NGINX pre-configured.
InMotion Hosting’s WordPress Hosting platform provides pre-configured NGINX, set up by experts, providing high-performance WordPress hosting with the convenience of more traditional offerings. The WordPress Hosting platform automatically configures NGINX for an optimal caching experience for typical WordPress websites. Of course, not all websites cache equally well, and a website’s content must cache properly in order to provide the greatest benefit from NGINX. Thus, InMotion Hosting’s WordPress Hosting platform also offers easy-to-use, proprietary tools for further tailoring NGINX’s caching performance. This allows customers to match NGINX’s performance to the needs of their specific WordPress websites, resulting in better cache rates and proper performance of dynamic content.
An excellent choice for every WordPress user, InMotion Hosting’s WordPress Hosting platform can dramatically improve site performance without requiring the site owner to become an expert in NGINX.