Question

Magento with Varnish

When using Magento with plain old Varnish, you can configure http_cache_hosts in app/etc/env.php to instruct Magento to automatically purge Varnish caches when Magento Caches are flushed from either Admin or Cli.

Magento DevDocs - Configure Magento To Purge Varnish

Magento Cloud with Fastly

When using Magento Cloud with Fastly, there are Fastly Purge Options in Admin Configuration for Category/Product/CMS Page that when set to "Yes" instruct Fastly to automatically purge those caches when a cache invalidating event occurs. This appears to be a feature parity of the http_cache_hosts, but it's not explicitly clear.

Magento DevDocs (Cloud) - Configure Purge Options

I'm trying to understand if http_cache_hosts is even necessary when using Fastly and what is the correct way of configuring Magento Cloud with Fastly to automatically purge Fastly caches when Magento cache is flushed from Admin or CLI

Was it helpful?

Solution

Got into contact with Magento Cloud Support about this.

Magento Cloud Support Response

You should not need to configure http-cache-hosts with the Advanced Fastly settings. The Fastly settings will generate the needed VCL for you, so it should only be necessary to upload the VCL snippet from the admin to configure Fastly Purging.

So it appears that the traditional http-cache-hosts that would be used with Varnish are not needed when using Fastly. Fastly exposes system configuration for automatic purging which get uploaded and sent as VCL for us when making changes to that configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top