Support » Plugin: Proxy Cache Purge » Custom Filters

  • Resolved Tim

    (@tjalexander70)


    I tried adding a custom filter to my functions.php found here: https://github.com/Ipstenu/varnish-http-purge/wiki/Custom-Filters

    function my_varnish_urls( $urls, $postid ) {
    	$myurl = 'http://example.com/newest/';
    	array_push( $urls, $myurl ) ;
    return $urls;
    }
    add_filter( 'vhp_purge_urls', 'my_varnish_urls' );

    It does not seem to work. I trying to use the Custom Simple Rss (https://wordpress.org/plugins/custom-simple-rss/) plugin and need it to update when a new post is pubished. It creates a url that looks like this:

    https://example.com/?call_custom_simple_rss=1&csrp_cat=-17&csrp_thumbnail_size=735x400

    Any ideas why it would not work?

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter Tim

    (@tjalexander70)

    It was 5 seconds old because I cleaned varnish using the plugin, as I mentioned, to check the header after turning off Cloudflare.

    So, is your advice to contact DreamHost’s support?

    Thread Starter Tim

    (@tjalexander70)

    Is there a snippet that I can add to my functions.php to schedule a full site purge?

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    A moment of thought… When you tried the manual curl, did you do it from your own laptop or from the server? Most servers are set up to ignore those from outside the server to prevent some jerk from DDoSing your box.

    So, is your advice to contact DreamHost’s support?

    In this case, yes because I think the fastest fix would be to tell DH support “I need ALL pages with “call_custom_simple_rss” in them to NEVER be cached.”

    The best idea I have right now is there’s something about the amount of variables in the URL that’s somehow conflicting with an aspect of Varnish so it doesn’t understand what to do when you add the page in.

    Is there a snippet that I can add to my functions.php to schedule a full site purge?

    Not easily, by design. It can get really expensive (server processing wise) and slow things down if you run it too often.

    If that’s really what you wanted to do, I would recommend making a real cron job instead and run curl -X PURGE "https://123.45.67.89/*" -H "host:www.example.com" directly.

    https://help.dreamhost.com/hc/en-us/articles/215088668-How-do-I-create-a-cron-job-

    I would NOT recommend running a cron to flush the whole site more than once an hour, since then you just have a negative return on caching in the first place.

    Thread Starter Tim

    (@tjalexander70)

    I will reach out to DreamHost’s support today. Thank you.

Viewing 4 replies - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.