Page Caching

Configure full page cache for your site to increase performance and ease the load on your WordPress pods.

Enable Page caching

When you enable Page Caching, you can choose between Memcached and Redis for your site’s backend cache. With Memcached there is no additional configuration required from your side, as it uses the same instance used for the WordPress Object Cache.

Page Caching

If you want to use Redis instead, you will have to deploy Redis and specify its Host and Port.

Page Caching

Query parameters

Both Memcached and Redis allow you to setup which query parameters should be included or ignored by the cache. If a request contains at least one query parameter that is not present in these fields, the cache is skipped. So, to avoid this, setup the following:

  • Included Query Parameters - the parameters you enter here will be included in the cache key and if they have different values they will be saved as different pages in the cache; these are the query parameters that influence the content that is rendered on the page, like page_id, category_name, page (if permalinks are not enabled); for example, presslabs.com/blog?page=2 will be served from cache and it will be different from presslabs.com/blog?page=3
  • Ignored Query Parameters - these are query parameters that should be ignored by the cache ( they are not included in the cache key), because the values of these parameters don’t influence how the page is rendered, like utm_content, utm_source, fbclid; for example presslabs.com/blog?page=2&utm_source=facebook.com will be saved and served from cache as presslabs.com/blog?page=2

After adding the parameters don’t forget to save the changes.

Advanced Settings

For more page cache settings, select Show Advanced Settings:

Page Caching- Advanced Settings

Cacheable Response Status Codes specify which pages will be cached based on their HTTP response status codes.

Default TTL specifies the default duration in seconds after which the cached pages will expire. The value is ignored if a duration is specified in one of the Cache-Control or Expires response headers.

Honor bypass from response headers allows bypassing caching pages when specified so by the Cache-Control or the Expires response headers, in the following cases:

  • if Cache-Control: private is present, the page is not cached;
  • if Cache-Control: no-store is present, the page is not cached;
  • if Cache-Control: no-cache is present, the page is not cached;
  • if Cache-Control: max-age=0 is present, the page is not cached;
  • if Expires: <date-from-the-past> is present, the page is not cached.

Bypassing the page cache

Currently the page cache is automatically bypassed in the following situations:

  • if the user is logged in or if there are other cookies that might indicate dynamic content is expected;
  • for some sensible locations, such as: sitemaps, feed, admin-ajax, wp-login etc.
  • if the request URI contains any query parameter that is not included or ignored in the query parameter fields

For more details, you may consult our nginx config for page caching .