From d288892c30aeb5ec1c11f3e467059d5b6c41baed Mon Sep 17 00:00:00 2001 From: Luke Stevenson Date: Thu, 19 Feb 2026 23:44:10 +1100 Subject: [PATCH] Turns off Caching for JSON responses Adds headers to json response to avoid caching of the response --- flight/Engine.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flight/Engine.php b/flight/Engine.php index fe88301..00ca6f7 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -934,6 +934,9 @@ public function _json( $this->response() ->status($code) ->header('Content-Type', 'application/json') + ->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') + ->header('Pragma', 'no-cache') + ->header('Expires', '0') ->write($json); if ($this->response()->v2_output_buffering === true) { $this->response()->send();