From ae593463ee895bb0a73cef03827917ed8c8534f1 Mon Sep 17 00:00:00 2001 From: James #FFFFFF Date: Sun, 29 Dec 2024 23:53:39 +0000 Subject: [PATCH] Set no-cache headers for health check endpoint Resolves #16364 --- CHANGELOG-WIP.md | 1 + src/controllers/AppController.php | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-WIP.md b/CHANGELOG-WIP.md index c0c64b6ab93..07854ddd1f3 100644 --- a/CHANGELOG-WIP.md +++ b/CHANGELOG-WIP.md @@ -16,4 +16,5 @@ ## System - Database rows with foreign keys referencing nonexistent rows are now deleted via garbage collection. - Pages which contain image transform generation URLs now set no-cache headers. ([#16195](https://github.com/craftcms/cms/discussions/16195)) +- The `app/health-check` action now sends no-cache headers. ([#16364](https://github.com/craftcms/cms/pull/16364)) - Updated Twig to 3.15. ([#16207](https://github.com/craftcms/cms/discussions/16207)) diff --git a/src/controllers/AppController.php b/src/controllers/AppController.php index 30af6ba4288..97b83f8fa1a 100644 --- a/src/controllers/AppController.php +++ b/src/controllers/AppController.php @@ -95,6 +95,7 @@ public function beforeAction($action): bool public function actionHealthCheck(): Response { // All that matters is the 200 response + $this->response->setNoCacheHeaders(); $this->response->format = Response::FORMAT_RAW; $this->response->data = ''; return $this->response;