With each new post Borlabs Cache automatically refreshes not only that post but also your home page (front page) and the archives of the corresponding post types. If you want to refresh additional e.g. pages or post types use the code from the following example.
In this example "jobs" is a custom post type for vacancies. An overview of those is realized by WPBakery Page Builder (Visual Composer) or a similar page builder which is not of post type "jobs". The following code allows to refresh both a new vacancy (post type "jobs") and the overview of those at the same time:
add_action('save_post', 'borlabsCacheSavePost', 11, 3); function borlabsCacheSavePost($postId, $post, $update) { if (!empty($post->post_status) && $post->post_status == 'publish') { if (class_exists('\Borlabs\Factory')) { // Refresh site when a post of a custom post type is published if (in_array($post->post_type, ['jobs', 'my_custom_post_type'])) { // Refresh a specific post by using its id 123 \Borlabs\Factory::get('Cache\Frontend\Garbage')->refreshCache(123, 0, 0); // Refresh all posts of a specific post type e.g. jobs \Borlabs\Factory::get('Cache\Frontend\Garbage')->refreshCache(0, 'jobs', 0); } } } }