Skip to content

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Feb 7, 2025

Alternative to #5963

While i initially pushed this fix to the earlier PR i think it would be enough in its own without affecting mobile app behaviour. We save the most expensive step to check file existence on the actual remote storage by just using the file cache entry.

This improves the situation for any external storage as well as federated shares by saving 4 checks on the remote for file existence, only if we know a file we will access it to get the content.

This of course has one limitation, that the file needs to be known to Nextcloud already, but should be fine for most of the cases.

Todo from chat:

  • The propfind does not return a file id anymore (empty file or not)
  • I was wondering why I see the readme.md file being accessed even when I directly reload the page. Looked into redis and saw:

1738924269.607566 [0 unix:/var/run/redis/redis-server.sock] "GET" "8b16b520c496b13f920772e0b509487a/text_workspace175301_549b3998cd6b2f08d58c4033e85a084a"
1738924269.617739 [0 unix:/var/run/redis/redis-server.sock] "SETEX" "8b16b520c496b13f920772e0b509487a/text_workspace175301_549b3998cd6b2f08d58c4033e85a084a" "3600" """"
Turns out the file was empty, so the check at

$cache = $this->cacheFactory->createDistributed('text_workspace');
$cacheKey = $file->getFileInfo()->getId() . '_' . $file->getFileInfo()->getEtag();
if ($cachedContent = $cache->get($cacheKey)) {
return $cachedContent;
}
fails.

Might be a corner case, but guess filing an issue makes sense?

@juliusknorr juliusknorr requested a review from ShGKme February 7, 2025 10:20
@juliusknorr juliusknorr force-pushed the perf/use-filecache-for-workspace-check branch 2 times, most recently from d42f63e to dd47c83 Compare February 12, 2025 20:57
@juliusknorr juliusknorr requested a review from a team February 12, 2025 21:08
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr juliusknorr force-pushed the perf/use-filecache-for-workspace-check branch from dd47c83 to af11b18 Compare March 18, 2025 20:04
@juliusknorr juliusknorr merged commit f38384e into main Mar 18, 2025
65 checks passed
@juliusknorr juliusknorr deleted the perf/use-filecache-for-workspace-check branch March 18, 2025 20:16
@juliusknorr
Copy link
Member Author

/backport to stable31

@juliusknorr
Copy link
Member Author

/backport to stable30

@juliusknorr
Copy link
Member Author

/backport to stable29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants