Hi, i think it is the codings issue as you had mentioned that it only purge 1. The home page (not any paginations under it) , so it means it will never purge the page eg. https://example.com/page/2/, https://example.com/page/3/, https://example.com/page/4/, https://example.com/page/5/ …
I had customized the codings in so it will works for purging the home page and paginations under it.
In my functions.php, i add extra count total posts function.
// Count total posts.
function count_total_posts() {
$count_post = wp_cache_get(‘count_all_post’);
if ($count_post === false) {
$count_post = wp_count_posts()->publish;
wp_cache_set(‘count_all_post’, $count_post);
}
return $count_post;
}
In /wp-content/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php
start from lines: 1113
// Purge the home page as well if SWCFPC_HOME_PAGE_SHOWS_POSTS set to true
if( defined( ‘SWCFPC_HOME_PAGE_SHOWS_POSTS’ ) && SWCFPC_HOME_PAGE_SHOWS_POSTS === true ) {
array_push($listofurls, home_url(‘/’));
// Changes
if( $this->main_instance->get_single_config(‘cf_post_per_page’, 0) > 0 ) {
$post_count = count_total_posts();
$post_pages_number = ceil($post_count / $this->main_instance->get_single_config(‘cf_post_per_page’, 0) );
for ($j=2; $j<=$post_pages_number; $j++) {
$home_paginated_url = home_url(‘/page/’) . user_trailingslashit($j);
array_push($listofurls, $home_paginated_url);
}
}
}
So it will work for purging the homepage as well as the pagination under it.
@isaumya Do you have any suggestion for the codings and how can I improve it?