Skip to content

Commit

Permalink
Merge pull request #45957 from nextcloud/perf/cache-storage-stats-header
Browse files Browse the repository at this point in the history
perf: Tell browsers to cache storage stats endpoint as it is cached
  • Loading branch information
st3iny authored Jun 19, 2024
2 parents cd7530c + 40a416b commit ab85568
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/files/lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ public function getRecentFiles() {
*/
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;
}

/**
Expand Down

0 comments on commit ab85568

Please sign in to comment.