• Resolved veggera

    (@veggeras)


    Hi,

    Your plugin looks promising; I have tried configuring it to purge the cache automatically when new posts are added on-site, but it does not work.

    My config include:

    define(?'SWCFPC_HOME_PAGE_SHOWS_POSTS',?true?);
    

    My PHP function include:

    add_filter( 'swcfpc_post_related_url_init', function($listofurls) {
        return array_merge(
            $listofurls,
            [
                get_home_url()
            ]
        );
    } );

    I have placed it on my NGiNX, but it also does not work on the browser cache.
    I’m on Runcloud. Any help is much appreciated.

    Best Regards

Viewing 1 replies (of 1 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @veggeras,
    The plugin should auto purge the cache of the post page and the related pages when a post is published. But for some reason if the home pga of yoru website is not getting purged when a post is published, then you should add the above code in functions.php file.

    add_filter( 'swcfpc_post_related_url_init', function($listofurls) {
        return array_merge(
            $listofurls,
            [
                get_home_url()
            ]
        );
    } );

    The above code when placed inside function.php will make sure your home page is always gets purged with a post is published. Also instead of using get_home_url() function, you should consider using site_url('/') function.

Viewing 1 replies (of 1 total)
  • The topic ‘Fail to purge cache on new published posts’ is closed to new replies.