Observer/MarkEsiBlock.php
public function execute(Observer $observer) // @codingStandardsIgnoreLine - required, but not needed
    {
        if ($this->fastlyConfig->isFastlyEnabled() != true) {
            return;
        }

        // If not set, causes issues with embedded ESI
        $this->response->setHeader("x-esi", "1");
    }
public function execute(Observer $observer) // @codingStandardsIgnoreLine - required, but not needed
    {
        if ($this->fastlyConfig->isFastlyEnabled() != true) {
            return;
        }

        // If not set, causes issues with embedded ESI
        $this->response->setHeader("x-esi", "1");
    }
Set x-esi header on ESI response request
If omitted, causes issues with embedded esi tags

@param \Magento\Framework\Event\Observer $observer
@return void