Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workspace): Use filecache existance for checking if readme exists #6891

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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 force-pushed the perf/use-filecache-for-workspace-check branch from d42f63e to dd47c83 Compare February 12, 2025 20:57
@juliusknorr juliusknorr requested a review from a team February 12, 2025 21:08
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.

2 participants