From 9974f0b722ae3dd8d7e8d8cbc0ff350bd64fc7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 5 Jul 2024 14:39:30 +0200 Subject: [PATCH] perf: Set session.cache_limiter at runtime to avoid clients caching static assets served by PHP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default there is a Pragma: no-cache header set due to the default value `no-cache` of session.cache-limiter, which will cause Chrome and iOS to not cache even with a different Cache-Control header set on the response. Signed-off-by: Julius Härtl --- lib/private/Session/Internal.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index 5fb9b05c5f4f3..c0c72d1ce01be 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -52,6 +52,7 @@ class Internal extends Session { public function __construct(string $name) { set_error_handler([$this, 'trapError']); $this->invoke('session_name', [$name]); + $this->invoke('session_cache_limiter', ['']); try { $this->startSession(); } catch (\Exception $e) {