Merge pull request #45957 from nextcloud/perf/cache-storage-stats-header

perf: Tell browsers to cache storage stats endpoint as it is cached
pull/45963/head
Richard Steinmetz 2 years ago committed by GitHub
commit ab8556872e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      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;
}
/**

Loading…
Cancel
Save