Skip to content

Commit

Permalink
perf(rich_workspace): only add property for parent
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <[email protected]>
  • Loading branch information
ShGKme committed Jun 28, 2024
1 parent f160174 commit 2d2f5fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/DAV/WorkspacePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,19 @@ public function propFind(PropFind $propFind, INode $node) {
return;
}

// Only return the property for the parent node and ignore it for further in depth nodes
// Otherwise requesting parent with description files for all the children makes a huge performance impact for external storages children
if ($propFind->getDepth() !== $this->server->getHTTPDepth()) {
return;
}

$node = $node->getNode();
try {
$file = $this->workspaceService->getFile($node);
} catch (StorageNotAvailableException $e) {
$file = null;
}

// Only return the property for the parent node and ignore it for further in depth nodes
$propFind->handle(self::WORKSPACE_PROPERTY, function () use ($file) {
$cachedContent = '';
if ($file instanceof File) {
Expand Down

0 comments on commit 2d2f5fb

Please sign in to comment.