Varnish: Purge says it works but doesn't remove old content

Refresh

November 2018

Views

556 time

2

I'm running a stand alone instance of varnish on a Digital Ocean Ubuntu VM which basically works fine. The setup is used to take load of an older wordpress server that sits anyhwere else. That works quite well but i'm having a hard time getting content purged. And when talking about purge i mean to invalidate the cache for a URL to force varnish to fetch a fresh version from the backend (just to make sure as i've seen some irritation about purge/ban).

I have setup an ACL for purge and as far as i can see with varnishlog the purges get accepted - on one side from the WordPress blog (where W3TC handles the purges) as well es from the local console where i tried to purge with curl -X PURGE http://url.to.purge

The problem is that i still get the old versions of the URL in the browser on matter what i do locally.

This is how i handle purge in vcl_recv:

  if (req.method == "PURGE") {
    if (!client.ip ~ purge) {
      return(synth(405,"Not allowed."));
    }
    return (purge);
  }

and i get VCL_error(200, Purged) on every purge so i guess it's probably ok.

Looks like i'm still doing things wrong. After giving service varnish a restart the full cache refreshes and the pages refresh too - until then varnish keeps everything for ages - no matter how much i'm purging.

my Varnish version is 4.0.3.

Any idea?

Thanks,

Frank

0 answers