public function dispatchLoopShutdown()
{
$code = (string) $this->getResponse()->getHttpResponseCode();
if ($code && ($code[0] == "4" || $code[0] == "5")) {
$this->writeLog();
// put the response into the cache, this is read in Pimcore\Controller\Action\Frontend::checkForErrors()
$responseData = $this->getResponse()->getBody();
if (strlen($responseData) > 20 && !session_id()) {
// do not cache if there's no data or an active session
if ($this->cacheKey) {
\Pimcore\Cache::save($responseData, $this->cacheKey, ["output"], 900, 9992);
}
}
}
}