Skip to content

Commit

Permalink
perf: Set session.cache_limiter at runtime to avoid clients caching s…
Browse files Browse the repository at this point in the history
…tatic 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>
  • Loading branch information
juliushaertl committed Jul 5, 2024
1 parent 915eef6 commit 9c76acb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/private/Session/Internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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) {
Expand Down

0 comments on commit 9c76acb

Please sign in to comment.