This article follows up on How to manage your site's dynamic cache and WordPress: Aruba HiSpeed Cache plugin. It shows what the dynamic cache does for your website during a surge of visitors or bots, how to check that it really works on your site, and what to do if pages are not being cached.
What the dynamic cache does for you
A page stored in the dynamic cache is delivered to the visitor directly from our proxy servers, through which all traffic to your website passes. Your web hosting does not have to build the page, so no PHP runs and no database queries are made. The difference is most visible during a sudden surge, for example when a social network's bot crawls the website in bulk after an ad campaign is launched.
On a test e-shop running WordPress and WooCommerce, we replayed a real bot surge: 2,409 requests within five minutes, peaking at 190 per second, to the home page and nine product pages.
| No cache | WordPress cache plugin | Dynamic cache |
|---|
| Requests served within 20 s | 64% | 100% | 100% |
| Typical response time | 8.5 s | 0.22 s | 0.09 s |
| Requests processed by the web hosting | 2,409 | 2,409 | 10 |
| Impact on other visitors | slowdown, brief outage | none | none |
With the dynamic cache, only ten requests reached the web hosting: the first load of each page. The cache handled all the others. Without the cache, all PHP processes of the web hosting were busy and a third of the requests got no response within 20 seconds. On a more resource-intensive website with more plugins, a surge like this can exhaust the resources allocated to the web hosting, causing the website to become unavailable.
Response time at rest and under load
On the same e-shop, we measured how quickly the server starts sending the home page and a product page (time to first byte, TTFB). We measured at rest and under heavy traffic, when the website was building more pages at once than it could handle.
| Typical response time | At rest | Under heavy traffic |
|---|
| No cache | 340–450 ms | 580–650 ms, often over 1 s |
| WordPress cache plugin | 22–25 ms | 90–130 ms, sometimes over 300 ms |
| Dynamic cache | 9 ms | 10 ms |
The dynamic cache responds about 35 times faster than a website without a cache and, above all, just as fast no matter what is happening on the website. A cache plugin is also fast at rest, but it slows down together with the website under load, because even a page from the plugin has to wait for a free PHP process. During a surge, the dynamic cache therefore keeps your website fast exactly when it matters most.
The cache does not speed up the first load of a page that is not cached yet. Such a load takes as long as without a cache. Every following visitor, however, gets the page from the cache.
How to check that the cache works
The basic check using the x-aruba-cache header is described in How to manage your site's dynamic cache. For a reliable check, we recommend:
- Open the website in a private (incognito) browser window. Being logged in to the administration bypasses the cache.
- Load the same page twice in a row and, in the developer tools (F12, Network tab), check the response headers of the first item.
- On the second load, the header must read
x-aruba-cache: HIT. - Check several types of pages: the home page, a category and one article or product. Some plugins block the cache only on certain pages.
If you use the command line, simply run this twice:
curl -s -o /dev/null -D - https://www.your-website.com/ | grep -i -E "x-aruba-cache|cache-control|set-cookie"
Why pages are not being cached
The dynamic cache stores a page only if the website allows it with the Cache-Control header. The response headers tell you where the problem is:
| What you see in the headers | Cause | Solution |
|---|
x-aruba-cache: MISS on every load, Cache-Control: no-store, no-cache, must-revalidate and a PHPSESSID cookie | A plugin, theme or script starts a PHP session on every page. PHP then automatically forbids caching the page. | Find the plugin that starts the session (see below) and configure it not to start it for all visitors, or replace it. |
Cache-Control contains private, no-store or no-cache, but there is no PHPSESSID | The header is sent by a plugin, a theme or a rule in .htaccess. | Check the settings of your cache, security and optimisation plugins and the rules in .htaccess. |
x-aruba-cache: BYPASS | You are logged in, you have a cart cookie, or the address is excluded (cart, checkout, administration and similar). | This is correct behaviour. Test in a private window. |
The x-aruba-cache header is missing completely | The dynamic cache is not enabled for the web hosting, or the page sends Cache-Control: private (for example the cart, or pages for a visitor with items in the cart). | If the header is missing even on the home page in a private window, enable the cache in the customer administration as described in How to manage your site's dynamic cache. Otherwise, check the Cache-Control header. |
| The response is not an HTML page (for example JSON or plain text) | The dynamic cache stores HTML pages only. | This is intentional. Data for applications and AJAX is not cached. |
Addresses that differ in their parameters (for example ?utm_source=... or ?fbclid=...) are cached separately. The first load of each such address is therefore always processed by the website.
How to find the plugin that blocks the cache
The most common cause is a plugin that needlessly starts a PHP session for every visitor. Typical examples are plugins for marketing and visitor tracking, forms, language versions, loyalty programmes or age verification.
- Confirm the symptom. In a private window, check whether the website sends a
PHPSESSID cookie. If it does, a PHP session is the cause. - Search the code. Over FTP or SSH, search for
session_start in the wp-content/plugins and wp-content/themes directories, for example with grep -rl session_start wp-content/plugins wp-content/themes. The result shows the suspect plugins. - Deactivate plugins one by one. Ideally on a copy of the website or outside peak hours, deactivate the suspect plugins one at a time. After each step, check again in a private window whether the
PHPSESSID cookie is gone and the page gets a HIT. - Change the settings or replace the plugin. Some plugins have an option that limits the session to the pages where it is really needed. Otherwise, contact the plugin's author or use a different one.
E-shops (WooCommerce)
WooCommerce works with the dynamic cache without any special settings:
- The home page, categories and products are served from the cache to visitors who are not logged in and have nothing in the cart.
- The cart, checkout and customer account are never cached.
- As soon as a visitor adds something to the cart, the website serves them directly, so they always see their current cart. Nobody is ever shown someone else's cart.
- After a product is edited, for example its price or stock availability, the Aruba HiSpeed Cache plugin automatically refreshes the cache of the affected pages.
If the e-shop still gets MISS or sends a PHPSESSID cookie, the cause is usually one of the add-on plugins, not WooCommerce. Follow the previous section.
Custom PHP applications
A page without its own Cache-Control header is served from the dynamic cache for up to 12 hours. A plugin that automatically refreshes the cache after content changes is available for WordPress only. In a custom application, a content change therefore shows only after the cache expires or after you clear it manually in the customer administration. You can, however, shorten the caching time for each page directly in your script:
- Pages that change only occasionally and look the same to all visitors (home page, catalogue, articles) can send, for example,
header('Cache-Control: public, max-age=600');. The cache will then refresh them every 10 minutes. Even such a short time saves the vast majority of the server's work during a surge. - Pages that must always be current or contain personal data (logged-in user, cart, forms) should be excluded from the cache with
header('Cache-Control: private');. Excluding pages via .htaccess is described in How to manage your site's dynamic cache. - Call
session_start() only where you really need a session, for example after login or after adding to the cart, not on every page. Otherwise nothing gets cached.
When the caching time runs out, the x-aruba-cache header shows EXPIRED. At that moment the cache fetches the page from the website again, and the following visitors get a HIT again.
Dynamic cache or a cache plugin?
A WordPress cache plugin also helps a lot, because it serves ready-made pages. Each request, however, still occupies a PHP process of the web hosting. The dynamic cache handles the request on our proxy servers before it ever reaches the web hosting, which is why it protects best during surges. If you use a cache plugin, make sure it does not send headers that disable the dynamic cache. The x-aruba-cache header must show HIT.
Before you contact customer support
A working dynamic cache is the foundation of a fast and stable website on our web hosting. That is why it is the first thing we check when dealing with slow loading or long response times. If the cache is not active on the website, or the website blocks it, we will first ask you to get it working by following this guide. We do not handle complaints about web hosting performance and response times for websites without a working dynamic cache. We will, however, be glad to help you set the cache up.
Related articles