Skip to content

Commit

Permalink
Output 'X-Magento-Cache-Debug' header
Browse files Browse the repository at this point in the history
  • Loading branch information
Ho Minh Hiep committed Mar 3, 2016
1 parent 68d9a91 commit 552294c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@ protected function addDebugHeaders(ResponseHttp $result)
{
$cacheControlHeader = $result->getHeader('Cache-Control');
if ($cacheControlHeader instanceof \Zend\Http\Header\HeaderInterface) {
$cacheControl = $cacheControlHeader->getFieldValue();
$this->addDebugHeader($result, 'X-Magento-Cache-Control', $cacheControl);
$this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'MISS', true);
$this->addDebugHeader($result, 'X-Magento-Cache-Control', $cacheControlHeader->getFieldValue());
}
$this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'MISS', true);
return $result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ public function aroundRenderResult(
}

if ($this->state->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) {
$cacheControlHeader = $result->getHeader('Cache-Control');
$cacheControlHeader = $response->getHeader('Cache-Control');
if ($cacheControlHeader instanceof \Zend\Http\Header\HeaderInterface) {
$cacheControl = $cacheControlHeader->getFieldValue();
$response->setHeader('X-Magento-Cache-Control', $cacheControl);
$response->setHeader('X-Magento-Cache-Debug', 'MISS', true);
$response->setHeader('X-Magento-Cache-Control', $cacheControlHeader->getFieldValue());
}
$response->setHeader('X-Magento-Cache-Debug', 'MISS', true);
}

$tagsHeader = $response->getHeader('X-Magento-Tags');
Expand Down

0 comments on commit 552294c

Please sign in to comment.