Varnish

Varnish is a cache that some hosts run in front of your WordPress site. It keeps its own copy of your pages. So when you update a post, Varnish can keep showing the old page. Softminal Cache can clear (purge) Varnish at the same time as its own cache, so visitors see your changes.

Who needs it

Only sites where the host runs Varnish. If you are not sure, ask your host. If there is no Varnish, leave this off. It does nothing useful there.

Do you use the Proxy Cache Purge plugin? Then the card says “Proxy Cache Purge is active too. Let one of them clear that cache, not both.”

How to turn it on

  1. Go to the Cache tab, then CDN, Cloudflare and Bunny.
  2. In the Cloudflare, Bunny and Varnish card, turn on Clear Varnish with this cache.
  3. Fill in Varnish address. Leave it empty to use your site’s own address. Or enter host and port, like 127.0.0.1:6081, if your host gave you one.
  4. Click Save changes.

What gets cleared

WhenWhat we clear in Varnish
You update or delete a postThe same pages we clear in our own cache: the post, the homepage and the archives that list it.
More than 50 pages change at onceEverything, in one request.
You click Purge, or a change clears the whole cacheEverything.
You click Clear them now on the cardEverything, at once.

We send a PURGE request with your site’s name, the way most Varnish setups and the Proxy Cache Purge plugin expect. To clear everything, we send /.* with the header X-Purge-Method: regex.

What can go wrong

After each purge, the card shows the last result, like “Everything cleared.” or “3 addresses cleared.” If it failed, you see why:

  • Varnish refused the purge (error 405) or error 403: your Varnish setup does not allow PURGE from your server. Ask your host to allow it.
  • Varnish answered with error and a number: the address may be wrong. Check the Varnish address, or leave it empty.
  • A connection error: nothing listens at that address. Check the host and port.

On a multisite network, only a network admin can set the Varnish address.

How to check it works

  1. Change a post and click Update.
  2. Open the card again. The last result should say the addresses were cleared.
  3. Open the post in a private window. You should see your change.

Use a CDN as well? See Cloudflare and Clearing the cache.

Still stuck? Please write to us at support.softminal.com. Our team will help you.