From f3bd0c2f16e038f687ba40ed2a575b04698ccd76 Mon Sep 17 00:00:00 2001 From: joost-florijn-kega Date: Mon, 19 Mar 2018 14:39:07 +0100 Subject: [PATCH] Replace the existing headers with the no cache headers The headers 'Cache-Control' and 'Pragma' need to be replaced otherwise they will be ignored because ZendHttp will always return the first entry. https://github.com/zendframework/zend-http/blob/master/src/Headers.php#L257 --- app/code/Magento/Customer/Controller/Section/Load.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Section/Load.php b/app/code/Magento/Customer/Controller/Section/Load.php index 6e73e070c790d..7a2345c91750c 100644 --- a/app/code/Magento/Customer/Controller/Section/Load.php +++ b/app/code/Magento/Customer/Controller/Section/Load.php @@ -64,8 +64,8 @@ public function execute() { /** @var \Magento\Framework\Controller\Result\Json $resultJson */ $resultJson = $this->resultJsonFactory->create(); - $resultJson->setHeader('Cache-Control', 'max-age=0, must-revalidate, no-cache, no-store'); - $resultJson->setHeader('Pragma', 'no-cache'); + $resultJson->setHeader('Cache-Control', 'max-age=0, must-revalidate, no-cache, no-store', true); + $resultJson->setHeader('Pragma', 'no-cache', true); try { $sectionNames = $this->getRequest()->getParam('sections'); $sectionNames = $sectionNames ? array_unique(\explode(',', $sectionNames)) : null;