CorefinityCorefinityDocs
Open the Control PanelControl Panel
Software and services · 7 of 8

Switch Varnish on or off for a Magento 2 site, change its version and purge its cache.

On this page

Before you start

  • You can open the site in Managed Websites. Anyone who can open a site can change its Varnish.
  • The site runs Magento 2 on the Medium (8 GB) package or larger.
  • Varnish takes its memory from the full-page-cache share of Redis and the unused RabbitMQ share. PHP memory and the price do not change.

Switch Varnish on or off

  1. Open Varnish configuration

    Go to Managed Websites, choose the site, then Software & services under Site settings. Choose Configure… beside Full-page cache.

  2. Use the switch

    The switch at the bottom of Varnish configuration reads On or Off. Turn it on or off.

  3. Confirm

    To switch on, choose the Version, then Switch on. To switch off, choose Switch off.

The change takes about a minute to apply, plus up to 3 minutes before it starts.

What happens
Switch onMagento is pointed at Varnish, which keeps whole pages in memory so repeat visits are answered without running PHP. Admin, checkout, customer pages and signed-in API calls are never cached.
Switch offMagento moves to its built-in full-page cache in Redis first. Your VCL and the version you chose are kept.

Change the version

While Varnish is on, choose Change… beside Full-page cache. The dialog marks the versions your Magento release supports, and your VCL is checked against the new one before the change starts.

The cache starts empty after a version change.

Purge the cache

Deployments purge everything for you, and Magento purges by tag when you save a product, category or page. To purge by hand:

  1. Open the purge dialog

    Choose Purge… in Varnish configuration, or Purge Varnish… in the site header's … menu.

  2. Choose what to purge

    Choose Everything, By tag, By address or By pattern, fill it in, then choose the purge button.

ChoiceLimit
By tagUp to 50 Magento cache tags.
By addressUp to 30 addresses.
By patternUp to 5 patterns, matched from the start of the path, query included.

A site has 10 purges an hour. Purges that deployments and Magento make do not count.

Automate this

Varnish

Switches Varnish on or off for a Magento 2 site.

PUT/api/corestack/sites/{site}/varnish
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/varnish \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'
Was this helpful?
Open in ClaudeOpen in ChatGPT