Presslabs cache specifications

There are 2 caches: one for the CDN, and one for the website’s HTML. The items in the CDN cache do not expire automatically and must be manually purged from the Cache section of your Presslabs Dashboard.

The cached pages have different expiration times based on their freshness. They have by default the following expiry times:

The multipliers cannot be changed, but the base TTL (which is 3600 seconds by default) can be increased by requesting this to our support team.

Please note that the taxonomy archives, the date archives, and the front page are invalidated on each post or page publication, or update. When comments are made, deleted, approved, or marked as spam, that particular article is refreshed as well.

Another important note is that an item can be refreshed only every 15 seconds. So, if you repeatedly click the Update button in the WordPress editor too soon, the content will not be refreshed.

Starting with April 2016 we’re caching all the GET requests, for any resources (even PHP, excluding some key paths like wp-login.php, wp-signup.php, wp-cron.php and xmlrpc.php). In order to make a request more cache-friendly and reliable we’re stripping down all the parameters which are not standard. In other words non-standard parameters are not passed to the backend (where php gets executed). This is the list of parameters which we cache and pass to the backend (WP API specific arguments and WP Query Vars from WordPress Query Vars – Codex):

Besides this list, all filter parameters like filter[*] are also passed to the backend and cached.

Additionally, you can add custom non-strippable parameters from our dashboard, Cache menu.


Manage absolute TTL for resources

If you have a page or post that needs a special cache refresh policy you can set the X-Accel-Expires header to the value you desire. Here is a sample code snippet

In this example the TTL is set for 5 minutes and the resource is /feed/:

add_action( 'send_headers', 'add_header_x_accel_expires' );
function add_header_x_accel_expires() {
    if ( strpos ( $_SERVER['REQUEST_URI'], '/feed/' ) === 0 ) {
        header( 'X-Accel-Expires: 300'); // number of seconds
    }
}