From 4023f1bcbfa9f90aab44ed67f872dbbd7968fb0b Mon Sep 17 00:00:00 2001 From: Benjamin Klein Date: Tue, 18 Jun 2019 23:34:07 +0200 Subject: [PATCH 1/2] #39 added no cache header --- .../VueStorefrontBridge/controllers/AbstractController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php b/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php index ee7872f..9a2761b 100644 --- a/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php +++ b/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php @@ -55,6 +55,7 @@ public function init() $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->getResponse()->setHeader('Access-Control-Allow-Origin', '*'); $this->getResponse()->setHeader('Access-Control-Expose-Headers', 'Link'); + $this->getResponse()->setHeader('Cache-Control', 'no-cache'); } /** From 6d291fa035c7dcbab2c40732bbe71ca38cad3049 Mon Sep 17 00:00:00 2001 From: Benjamin Klein Date: Tue, 18 Jun 2019 23:37:38 +0200 Subject: [PATCH 2/2] #39 move to result section couse init seems not to be fired --- .../VueStorefrontBridge/controllers/AbstractController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php b/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php index 9a2761b..b7cca5b 100644 --- a/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php +++ b/magento1-module/app/code/local/Divante/VueStorefrontBridge/controllers/AbstractController.php @@ -55,7 +55,6 @@ public function init() $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->getResponse()->setHeader('Access-Control-Allow-Origin', '*'); $this->getResponse()->setHeader('Access-Control-Expose-Headers', 'Link'); - $this->getResponse()->setHeader('Cache-Control', 'no-cache'); } /** @@ -262,7 +261,10 @@ protected function _result($code, $result) ], JSON_NUMERIC_CHECK ) - )->setHttpResponseCode($code)->setHeader('Content-Type', 'application/json'); + ) + ->setHttpResponseCode($code) + ->setHeader('Content-Type', 'application/json') + ->setHeader('Cache-Control', 'no-cache'); } /**