Skip to content

Commit 189cd15

Browse files
committed
perf: Set session.cache_limiter at runtime to avoid clients caching static assets served by PHP
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 <jus@bitgrid.net>
1 parent a98a0eb commit 189cd15

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/private/Session/Internal.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Internal extends Session {
2828
public function __construct(string $name) {
2929
set_error_handler([$this, 'trapError']);
3030
$this->invoke('session_name', [$name]);
31+
$this->invoke('session_cache_limiter', ['']);
3132
try {
3233
$this->startSession();
3334
} catch (\Exception $e) {

0 commit comments

Comments
 (0)