/** * Set appropriate Cache-Control headers * We have to set public headers in order to tell Varnish and Builtin app that page should be cached * * @param \Magento\Framework\View\Layout $subject * @param mixed $result * @return mixed */ public function afterGenerateXml(\Magento\Framework\View\Layout $subject, $result) { if ($subject->isCacheable() && $this->config->isEnabled()) { $this->response->setPublicHeaders($this->config->getTtl()); } return $result; }