Every time a page is opened, WordPress rebuilds it from scratch: PHP runs, the WordPress core, the theme and all the plugins are loaded, and then, after quite a few database queries, the HTML is generated. Even for a blog, this takes a fraction of a second, but for an online shop packed with plugins, it takes much longer. Caching saves this work, but there is a big difference between the various solutions in terms of who serves the cached page to the visitor.
In this article, we’ll look at how WordPress’s page cache works, where a slow step still remains, and how CloudLinux’s two tools – AccelerateWP and MAx Cache – resolve this. Both are available in our WordPress hosting plans, while MAx Cache is also included in every cPanel hosting plan, with the W3 Total Cache plugin.
How does the WordPress cache work?
A page caching plugin saves the fully rendered HTML page to a file the first time it is opened. The next visitor receives this file, so there is no need to run WordPress again or query the database. This is generally the biggest individual improvement that can be achieved on a WordPress site: server response time and time to first byte (TTFB) are reduced, and as a result, the Largest Contentful Paint (LCP) metric within the Core Web Vitals also improves. Our article on reducing TTFB covers the other components of response time in detail.
However, something still has to serve the stored file. With most plugins, this involves PHP running for every request: it loads a small section of WordPress, retrieves the cached file, and sends it back. Other plugins attempt to bypass PHP by using rewrite rules written in the .htaccess file; however, the web server must read through and evaluate these for every request. In both cases, there remains an unnecessary step between the request and the finished page, and on a busy day, when many visitors arrive at once, this places a strain on the hosting server’s resources.
What is MAx Cache?
MAx Cache is the CloudLinux Apache web server module that removes this final step from the process. When a request arrives, the web server itself checks whether there is a pre-generated cache file for the page, and if there is, it serves it immediately, without launching PHP. If there isn’t (for example, because no one has opened the page yet, or the visitor is logged in), the request is passed to PHP in the usual way, so nothing changes in how the website works.
What are the benefits?
- Faster response: cached pages reach the visitor via the shortest possible route, resulting in a shorter TTFB.
- Lower load: requests served from the cache use virtually no processor or memory, so your hosting resource allowance is reserved for genuinely dynamic requests (shopping basket, checkout, admin).
- More visitors on the same plan: the site can cope more easily with traffic spikes caused by a campaign, newsletter or social media shares.
MAx Cache is a server-level solution: you do not need to install a separate plugin; you simply need to use a supported caching plugin. There are currently two such plugins: AccelerateWP and W3 Total Cache.
What is AccelerateWP?
AccelerateWP is CloudLinux’s WordPress accelerator, which can be enabled via cPanel in our WordPress hosting plans with a single toggle. There’s no need to search for and configure a caching plugin: AccelerateWP installs its own plugin and activates it straight away:
- full-page caching, with a separate mobile version,
- cache preloading, which rebuilds cleared pages in the background,
- the minification of CSS and JavaScript files,
- browser caching and compression for static files.
You can enable further optimisations – such as lazy loading of images and videos, delaying the execution of JavaScript or database cleanup – all in one place in the WordPress admin, and try them out one by one.
AccelerateWP also monitors your website: it generates advice from slow requests, and if it finds that caching would help a lot, it shows ‘Advice available’ on the cPanel AccelerateWP interface, with the pages that would speed up. You can apply the advice with a single click.
The WP Pro plan also includes the AccelerateWP Redis object cache. This speeds up the parts that the page cache cannot help with: the online shop’s basket and checkout, pages for logged-in users and the WordPress admin interface, as it stores the results of frequently used database queries in memory.
AccelerateWP and MAx Cache together
The two build on each other: AccelerateWP creates and keeps the cache files up to date, while MAx Cache serves them by bypassing PHP. You can enable MAx Cache with a single toggle in the AccelerateWP settings, on the Add-ons tab; the system takes care of the rest: it writes the necessary settings into the website’s .htaccess file, and if you disable it later, it deletes them as well.
Our knowledge base articles, complete with screenshots, explain the steps for enabling AccelerateWP and configuring MAx Cache.
MAx Cache on cPanel hosting, with W3 Total Cache
AccelerateWP is included in our WordPress hosting plans, while MAx Cache works with all cPanel hosting plans, starting from the smallest one. To use this, you’ll need to use the popular, free W3 Total Cache plugin with the following settings:
- at least version 2.11.0 (which introduced support for MAx Cache),
- ‘pretty’ permalinks (e.g. Post name), because the W3 Total Cache disk cache does not work with simple URLs in the format
?p=123, - Page Cache enabled, in Disk: Enhanced mode,
- on the Performance › Extensions page, the MAx Cache extension enabled.
If you are currently using another caching plugin (such as WP Super Cache or WP Fastest Cache), please disable it first: only one caching plugin should be running on a website at any one time.
What the cache does not accelerate
The cache is intended for visitors who are not logged in. Requests from logged-in users, the shopping basket and checkout, the WordPress admin panel, and requests containing unknown query parameters (the part following ?) are still processed via PHP, as their content varies from visitor to visitor. If these sections are slow, instead of relying on the cache, you need to find the underlying cause: a resource-intensive plugin, a slow database query, or an external service that the page is waiting for. The cPanel X-Ray App tool helps with this, showing you where time is being spent, broken down by plugin and query.
The cache also has no effect on the loading speed of images, CSS and JavaScript files: for these, image optimisation, lazy loading and, where necessary, a CDN can help.
How do you know it’s working?
The caching plugin indicates, via a comment added to the end of the source code, that the page is being served from the cache; however, this does not reveal whether it was served by MAx Cache or by PHP. Our servers therefore add the X-CL-Served: 1 header to every response served by MAx Cache. Open the page in a private browser window (so that you are not logged in), and check the page’s response headers in the Network tab of your browser’s developer tools. If the line x-cl-served: 1 appears there, MAx Cache is working.
What is included in each plan?
| WordPress hosting | cPanel hosting | |
|---|---|---|
| MAx Cache | Yes, with AccelerateWP or W3 Total Cache | Yes, with W3 Total Cache |
| AccelerateWP | Yes, in every plan | No |
| Redis object cache | In the WP Pro plan | No |
If you’re setting up a WordPress site and don’t want to bother with caching settings, WordPress hosting is the convenient choice: pre-installed WordPress, WP Toolkit Deluxe, AccelerateWP and MAx Cache all in one plan. If you run multiple websites or use platforms other than WordPress, cPanel hosting is the more flexible solution, and with W3 Total Cache, you can still enjoy the benefits of MAx Cache.