Skip to content

Commit ab85568

Browse files
authored
Merge pull request #45957 from nextcloud/perf/cache-storage-stats-header
perf: Tell browsers to cache storage stats endpoint as it is cached
2 parents cd7530c + 40a416b commit ab85568

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/files/lib/Controller/ApiController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ public function getRecentFiles() {
238238
*/
239239
public function getStorageStats($dir = '/'): JSONResponse {
240240
$storageInfo = \OC_Helper::getStorageInfo($dir ?: '/');
241-
return new JSONResponse(['message' => 'ok', 'data' => $storageInfo]);
241+
$response = new JSONResponse(['message' => 'ok', 'data' => $storageInfo]);
242+
$response->cacheFor(5 * 60);
243+
return $response;
242244
}
243245

244246
/**

0 commit comments

Comments
 (0)