Skip to content

Commit

Permalink
remove cache control headers, fix is needed for them
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikesch-mp committed Aug 10, 2022
1 parent 6246a0c commit 7e27158
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/controllers/ImgController.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,15 @@ public function indexAction()
$imageHtml = "";
$res = $this->getMyimageHtml($serviceName, $hostName, $imageHtml);
header('Pragma: public');
/* makes trouble with IcingaDB or php8.1
if($this->refresh == "yes") {
header('Pragma: public');
header("Expires: ".gmdate("D, d M Y H:i:s", time() + $this->cacheTime)." GMT");
header('Cache-Control: max-age='.$this->cacheTime).', public';
} else {
header("Expires: ".gmdate("D, d M Y H:i:s", time() + 365*86440)." GMT");
header('Cache-Control: max-age='. (365*86440));
}
*/
header("Content-type: image/png");
if (! $res)
{
Expand Down Expand Up @@ -354,4 +355,4 @@ private function getMyimageHtml($serviceName, $hostName, &$imageHtml)
$imageHtml = $res;
return true;
}
}
}

0 comments on commit 7e27158

Please sign in to comment.