perf: Tell browsers to cache storage stats endpoint as it is cached

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/45957/head
Julius Härtl 1 year ago
parent c3354e9c84
commit 40a416ba00
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
  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