Skip to content

Commit 5d86efb

Browse files
juliusknorrAndyScherzinger
authored andcommitted
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 db748b4 commit 5d86efb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/private/Session/Internal.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class Internal extends Session {
5252
public function __construct(string $name) {
5353
set_error_handler([$this, 'trapError']);
5454
$this->invoke('session_name', [$name]);
55+
$this->invoke('session_cache_limiter', ['']);
5556
try {
5657
$this->startSession();
5758
} catch (\Exception $e) {

0 commit comments

Comments
 (0)