From 0c9c33d2f626c235ef24d9fabc723be11cd6088b Mon Sep 17 00:00:00 2001 From: winter Date: Tue, 28 Jan 2025 22:20:26 +0000 Subject: put some cache-control on static/storage resources --- routes/storage.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'routes/storage.php') diff --git a/routes/storage.php b/routes/storage.php index 341770b..2ea0fc7 100644 --- a/routes/storage.php +++ b/routes/storage.php @@ -11,6 +11,7 @@ Router::getInstance()->mount('/storage/:oid', function (array $args) { if ($obj == null) { throw new NotFound('unknown object'); } + header('Cache-Control: max-age=604800'); // 1 week header("Content-Disposition: inline; filename*=UTF-8''" . urlencode($obj->filename)); $obj->passthrough(); }); @@ -23,5 +24,6 @@ Router::getInstance()->mount('/upload/:token', function (array $args) { if (!$storage->exists($token)) { throw new NotFound('unknown object'); } + header('Cache-Control: max-age=604800'); // 1 week $storage->passthrough($token); }); \ No newline at end of file -- cgit v1.3