diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2024-06-19 08:10:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 08:10:24 +0200 |
commit | ab8556872e95f4e2ee909ef09af777dab891f297 (patch) | |
tree | 1fbf7122e5691aa8aa451b7104597097c86e27c3 /apps | |
parent | cd7530cd70f7c007f966d5965d778b68fa38b25e (diff) | |
parent | 40a416ba002e6de05cfa5cb1cbd129c7136a34d3 (diff) | |
download | nextcloud-server-ab8556872e95f4e2ee909ef09af777dab891f297.tar.gz nextcloud-server-ab8556872e95f4e2ee909ef09af777dab891f297.zip |
Merge pull request #45957 from nextcloud/perf/cache-storage-stats-header
perf: Tell browsers to cache storage stats endpoint as it is cached
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Controller/ApiController.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 9aceb10db00..64082fbfd85 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -238,7 +238,9 @@ class ApiController extends Controller { */ public function getStorageStats($dir = '/'): JSONResponse { $storageInfo = \OC_Helper::getStorageInfo($dir ?: '/'); - return new JSONResponse(['message' => 'ok', 'data' => $storageInfo]); + $response = new JSONResponse(['message' => 'ok', 'data' => $storageInfo]); + $response->cacheFor(5 * 60); + return $response; } /** |