Loopia Boost – Page cache

The page cache (full-page caching) in Loopia Boost stores PHP-generated pages as if they were static files. If pages on your website look the same for every visitor, it is unnecessary for the server to rebuild the page on each visit. Instead, the page cache serves a pre-built copy from a previous visit, making response times extremely fast. This replaces most of the functionality of standard cache plugins, such as W3 Total Cache or WP Super Cache for WordPress.

How do I enable the page cache?

The page cache is disabled by default and is currently activated manually by our support team. In the future this will be controlled directly in Loopia Customer zone, but for now you need to contact support@loopia.com to activate the feature.

How long does the page cache remain?

The length of time the cache remains depends on the HTTP status code returned by the page:

  • 302 – 5 minutes
  • 200 – 1 hour
  • 301 – 1 hour
  • Other – the page is not cached

You can adjust these times from your site by setting HTTP header values such as X-Accel-Expires and Expires.

How do I clear the page cache?

For specific subpages, the cache is most easily cleared by visiting the page and pressing Ctrl+F5 (Cmd+R on Mac) to perform a hard reload. This bypasses the cached page and generates a new one. If the returned page is cacheable, it is then stored in the cache for the next request.

The cache can also be cleared by inserting /purge/ after the domain name in the URL. This can clear one specific subpage or multiple subpages. These requests can only be made locally from the website itself, or from trusted IP addresses that support can add for you. Here are some example requests:

  • http://example.com/purge/ – clears the cache for the home page
  • http://example.com/purge/subpage/ – clears the cache for the subpage example.com/subpage/
  • http://example.com/purge/* – clears the entire cache for the website

How do I see if a page is cached?

Inspect the HTTP headers that the page returns. The x-cache header indicates whether the page was delivered from the cache. If the x-cache header is missing, the page cache may not be enabled on the page. The header can have the following values:

  • HIT – the page you see is a cached page.
  • MISS – the page you see was not cached, but may have been cached during your visit.
  • STALE – the page you see is cached, but the cache time has expired and a new page will be loaded in the background.
  • BYPASS – the browser asked the server to bypass the cache and deliver a new page, for example by pressing Ctrl+F5.

Why is my page not cached?

If the x-cache HTTP header is missing entirely (see above), the page cache may not be enabled on the page. It needs to be activated in order to function.

You can also check the HTTP headers sent from the server to the browser for any Set-Cookie headers. If any are present, the page will not be cached.

For WordPress in particular, you may have a plugin installed that prevents the page from caching properly. One way to investigate this is to deactivate plugins one by one to see if the cache starts working.

Note that some pages should not be cached, such as pages where you have logged in, or pages that should display different content for different visitors. Be sure to check these pages after the cache is enabled to make sure they are not being cached.

How do I use page cache in WordPress?

As long as the page cache is enabled, it should work in WordPress without any further configuration. We still recommend installing the Nginx Helper plugin. This plugin automatically clears the cache when pages or posts are updated, which simplifies your workflow when editing the site.

There is also a button for clearing the entire cache for the site. For this to work, the following line must be added to the wp-config.php file:

define('RT_WP_NGINX_HELPER_CACHE_PATH', $_SERVER['LOOPIA_FASTCGICACHE_DIR']);
Was this article helpful?

Related Articles