Kinsta Cache is a plugin installed by default on every Kinsta Website used to intelligently clear the cache on appropriate pages of your website.

In most cases you should use the default settings, only change them if you know what you’re doing. This documentation explains what each option means and how it affects your website speed and caching.

Plugin Settings

The plugin is set to work harmoniously with WordPress and our infrastructure. Please note that turning every setting on is not good practice. Calculating all the pages that need to be cleared and clearing them individually is a taxing process and can take a toll on your server. Before making any changes please make sure you know what you’re doing and read the full explanations below to learn why we’ve set up the plugin the way we did.

General Options

Clear blog page depth

This setting determines how deep your blog is purged. When a post is published the main blog page needs to be purged because this is where the new post shows up. The final post of the initial page is bumped down to the next page which is why we need to purge subsequent pages as well.

Purging all pages would take a significant toll on server resources especially during high load times and frequent publishing schedules. Purging the first 5 pages is a good balance as visitors tend to taper off after the first couple of pages.

Clear archive page depth

Archive pages tend to contain far fewer posts so we have set this to a default of 2 which should be enough to ensure your pages are up-to-date.

Clear blog Feeds

When you publish a new post your RSS feeds need to be purged as well to make sure that people consuming your content from feed readers like Feedly receive the updates. This setting is set to Yes by default to ensure speedy distribution of your content.

Clear static home page

This setting can be useful if you use a static home page that contains dynamic content. If you’re unsure what this means leave this setting on No and ask your developer if you are using a static home page with dynamic content. If so feel free to turn this setting to Yes.

If you set this option to Yes without using a static home page with dynamic content your website will use additional resources without actually doing anything.

Clear archive feeds

Archive feeds are not commonly used. These are RSS feeds for author, category and other archive pages. Clearing archive feeds takes considerable resources, only switch the setting to Yes. if you are absolutely sure that your users consume your content in this way.

Clear date archives

Date archives are almost never consumed directly. Date archives display all your posts in a given month, year or even a single day. This option is turned off because it would consume resources – needlessly in most cases. Only set this option to Yes if you regularly use data archives. If you are unsure it’s probably that you have no need for this setting.

Dedicated mobile plugin usage

If you use a dedicated mobile plugin such as WP Touch we need to use special caching to make sure mobile content is cached properly. This setting is switched off by default because it single handedly doubles the resources required for cache clearing. Only switch this option to Yes if you are absolutely sure your website uses a dedicated plugin to create the mobile version.

Clear Blog Cache

when a post is published

When set to Yes the main blog’s cache will be cleared when a new post is published. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a post is updated

When set to Yes the main blog’s cache will be cleared when an existing published post is updated. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a post is unpublished

When set to Yes the main blog’s cache will be cleared when an existing published post is unpublished. This can happen when the post is deleted or if it set to draft status again. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

Clear Singular Page Cache

when a post is published

When set to Yes the post’s single page cache will be cleared when it is published. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a post is updated

When set to Yes the published post’s single page cache will be cleared when it is updated. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a post is unpublished

When set to Yes the published post’s single page cache will be cleared when it is unpublished. This can happen when the post is deleted or if it set to draft status again. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a comment is published

When set to Yes the post’s single page cache will be cleared when a comment is added. This option is set to Yes by default to make sure comments are shown as soon as they are published.

when a comment is updated

When set to Yes the post’s single page cache will be cleared when a published comment is updated. This option is set to Yes by default to make sure comment changes are reflected as soon as they are made.

when a comment is unpublished

When set to Yes the post’s single page cache will be cleared when a published comment is unpublished. This may be due to a comment being removed or sent to spam. This option is set to Yes by default to make sure comment changes are reflected as soon as they are made.

Clear Archive Caches

when a post is published

When set to Yes all archive caches will be cleared when a new post is published. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a post is updated

When set to Yes all archive caches will be cleared when a published post is updated. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

when a post is unpublished

When set to Yes all archive caches will be cleared when a published post is unpublished. This can happen when the post is deleted or if it set to draft status again. This option is set to Yes by default to make sure your site is kept up-to-date with your changes.

Extending Functionality With Hooks

The following section is for professional developers only. Please do not attempt to extend the plugin’s functionality unless you have considerable WordPress experience. You may inadvertantly disable your caching or slow down your site.

Filter: kinsta-cache/purge_groups

The kinsta-cache/purge_groups filter can be used to modify purge groups. Purge groups contain urls that will be purged, grouped by type. The function receives one parameter – an array of purge groups. Here’s what a section of this array looks like:

Array
(
    [static_home] =>
    [blog] => Array
        (
            [url] => http://local.wordpress.dev/
            [archives] => Array
                (
                    [0] => http://local.wordpress.dev/page/2
                    [1] => http://local.wordpress.dev/page/3
                )

            [feeds] => Array
                (
                    [0] => http://local.wordpress.dev/feed/
                    [1] => http://local.wordpress.dev/rdf/
                    [2] => http://local.wordpress.dev/atom/
                )

        )

You can use the filter to manipulate whole groups of urls instead of modifying them one-by-one. The example below shows how you can remove the day archives altogether. This allows you to purge month and year archives but remove the daily archives which are almost never used.

add_filter( 'kinsta-cache/purge_groups', 'kc_remove_month_archives' );
function kc_remove_month_archives( $groups ) {
    unset( $groups['date_archives']['day'] );
    return $groups;
}

Filter: kinsta-cache/purge_list

The kinsta-cache/purge_list filter allows you to manipulate the urls that will be purged one by one. You can add your own custom urls programmatically with this filter with ease.

add_filter( 'kinsta-cache/purge_list', 'kc_add_custom_purge_urls' );
function kc_add_custom_purge_urls( $urls ) {
    $urls[] = site_url() . 'a-custom-static-page-with-dynamic-content/';
    return $urls;
}

Related Articles

Haven't Found What You Need?

Head back to the knowledge base or open a support ticket

Back To The Knowledge Base Open A Support Ticket
email newsletter

Use WordPress?

Join 15,000+ others who get our FREE weekly newsletter with WordPress tips on how to drive more traffic and revenue to your business!

You have Successfully Subscribed!

Send this to a friend