• Tim

    (@tjalexander70)


    I had initially thought this was an issue with Cloudflare but after testing it out it seems that Varnish cache does not update Category RSS feeds with new posts. The main feed looks to be updaing fine. It seems those are expiring maybe once a day. Is that by design? I am trying to use a specific Category feed and am running into trouble because it does not update with new posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    That is by design. In order to speed up the cache purging, I limited the URLs that get updated. More or less the same ones as WP Super Cache uses. The good news is there are filters so you can add in pages you’re using that are more rare:

    <?php
    function tjalexander70_varnish_urls( $urls, $postid ) {
    	$myurl = 'https://example.com/category/feed/';
    	array_push( $urls, $myurl ) ;
    return $urls;
    }
    add_filter( 'vhp_purge_urls', 'tjalexander70_varnish_urls' );

    You can add as many URLs as you want, though I do caution that every URL you add means a micro instance longer for the cache purge to run.

    Thread Starter Tim

    (@tjalexander70)

    Thanks. I just need two… I think. Stupid question but… that goes in functions.php, right?

    Thread Starter Tim

    (@tjalexander70)

    The snippet gives a critical error:

    `Error Details
    =============
    An error of type E_ERROR was caused in line 566 of the file /home/…/wp-content/themes/hitmag-pro/functions.php. Error message: Uncaught ArgumentCountError: Too few arguments to function tjalexander70_varnish_urls(), 1 passed in /home/wp_kst7tk/mychesco.com/wp-includes/class-wp-hook.php on line 294 and exactly 2 expected in /home/…/wp-content/themes/hitmag-pro/functions.php:566
    Stack trace:
    #0 /home/…/wp-includes/class-wp-hook.php(294): tjalexander70_varnish_urls(Array)
    #1 /home/…/wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array)
    #2 /home/…/wp-content/plugins/varnish-http-purge/varnish-http-purge.php(1045): apply_filters(‘vhp_purge_urls’, Array, 412599)
    #3 /home/…/wp-includes/class-wp-hook.php(294): VarnishPurger->purge_post(412599, Object(WP_Post))
    #4 /home/…/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
    #5 /home/…/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #6 /home/…/wp-includes/post.php(4384): do_action(‘save_post`

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category RSS Feeds Not Updating’ is closed to new replies.