Skip to content

Commit e5efd64

Browse files
ShGKmejuliusknorr
authored andcommitted
perf(rich_workspace): only add property for parent
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
1 parent 1b2e929 commit e5efd64

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/DAV/WorkspacePlugin.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,19 @@ public function propFind(PropFind $propFind, INode $node) {
7878
return;
7979
}
8080

81+
// Only return the property for the parent node and ignore it for further in depth nodes
82+
// Otherwise requesting parent with description files for all the children makes a huge performance impact for external storages children
83+
if ($propFind->getDepth() !== $this->server->getHTTPDepth()) {
84+
return;
85+
}
86+
8187
$node = $node->getNode();
8288
try {
8389
$file = $this->workspaceService->getFile($node);
8490
} catch (\Exception $e) {
8591
$file = null;
8692
}
8793

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

0 commit comments

Comments
 (0)