/**
  * Export Varnish Configuration as .vcl
  *
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function executeInternal()
 {
     $fileName = 'varnish.vcl';
     $varnishVersion = $this->getRequest()->getParam('varnish');
     switch ($varnishVersion) {
         case 3:
             $content = $this->config->getVclFile(\Magento\PageCache\Model\Config::VARNISH_3_CONFIGURATION_PATH);
             break;
         default:
             $content = $this->config->getVclFile(\Magento\PageCache\Model\Config::VARNISH_4_CONFIGURATION_PATH);
             break;
     }
     return $this->fileFactory->create($fileName, $content, DirectoryList::VAR_DIR);
 }
Example #2
0
 /**
  * Export Varnish Configuration as .vcl
  *
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function execute()
 {
     $fileName = 'varnish.vcl';
     $content = $this->config->getVclFile();
     return $this->fileFactory->create($fileName, $content, \Magento\Framework\App\Filesystem::VAR_DIR);
 }