Skip to content

Cache path by id - #43471

Merged
icewind1991 merged 3 commits into
masterfrom
cache-path-by-id
Mar 5, 2024
Merged

Cache path by id#43471
icewind1991 merged 3 commits into
masterfrom
cache-path-by-id

Conversation

@icewind1991

@icewind1991icewind1991 commented Feb 9, 2024

Copy link
Copy Markdown
Member

Cache fileid to path mapping.

The fact that a single fileid can have multiple paths complicates attampts to cache this information, however since most usages of getById only use a single item of the result, and always the same one (whether or not this is correct for that usage is another question 🙈). We can provide a new api that only returns a single result which makes caching easier.

We can get away with using a local cache without doing any active cache invalidation by checking that the node at the path we cached still has the correct fileid.

  • add getFirstNodeById to get a single node for id regardless of how many nodes with that id the user has
  • switch over all calls to getById that always use the first node to the new api
  • add caching to getFirstNodeById

I would recommend reviewing this PR commit-by-commit as most of the changes by LOC are mechanical changes to adjust to the new api.

Comment threadcore/Command/Preview/Generate.php Fixed
Comment threadlib/private/DirectEditing/Manager.php Fixed
Comment threadapps/dav/lib/Connector/Sabre/FilesReportPlugin.php Fixed
Comment threadapps/dav/lib/Direct/DirectFile.php Fixed
Comment threadapps/dav/lib/SystemTag/SystemTagsRelationsCollection.php Fixed
Comment threadapps/dav/lib/SystemTag/SystemTagsRelationsCollection.php Fixed
Comment threadapps/federatedfilesharing/lib/FederatedShareProvider.php Fixed
Comment threadapps/files_trashbin/lib/Trash/LegacyTrashBackend.php Fixed
Comment threadapps/dav/lib/SystemTag/SystemTagsRelationsCollection.php Fixed
@icewind1991
icewind1991force-pushed the cache-path-by-id branch 2 times, most recently from ed9cc7d to a2846beCompareFebruary 9, 2024 10:58
Comment threadapps/files_sharing/lib/Controller/ShareAPIController.php Fixed
Comment threadapps/files_sharing/lib/Controller/ShareAPIController.php Fixed
Comment threadapps/files_sharing/lib/Controller/ShareAPIController.php Fixed
Comment threadapps/files_sharing/lib/SharedStorage.php Fixed
@icewind1991
icewind1991force-pushed the cache-path-by-id branch 3 times, most recently from 6baf20a to 57e7266CompareFebruary 16, 2024 11:23
Comment threadlib/private/Files/Node/Root.php Fixed
Comment threadlib/private/Files/Node/Root.php Fixed
@icewind1991
icewind1991force-pushed the cache-path-by-id branch 2 times, most recently from 0a36121 to 68ad797CompareFebruary 16, 2024 12:03
@icewind1991
icewind1991 marked this pull request as ready for review February 16, 2024 12:57
@icewind1991
icewind1991 requested review from a team, ArtificialOwl, blizzz and nfebe and removed request for a teamFebruary 16, 2024 12:57
@icewind1991icewind1991 added the 3. to review Waiting for reviews label Feb 16, 2024
Comment threadlib/private/Share20/Share.php Outdated
@skjnldsvskjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Feb 23, 2024

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment threadlib/private/Files/Node/LazyFolder.php Outdated
Comment threadlib/private/Share20/Share.php Fixed
@icewind1991
icewind1991force-pushed the cache-path-by-id branch 2 times, most recently from dbb9170 to 3dfef53CompareFebruary 29, 2024 15:52
…des for the id
this should be enough in most(?) cases and makes efficient implementation and caching easier
Signed-off-by: Robin Appelman <robin@icewind.nl>
…rstNodeById
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991icewind1991 added 3. to review Waiting for reviews performance 🚀 and removed 2. developing Work in progress labels Mar 5, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsperformance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@icewind1991@Altahrim@github-advanced-security@come-nc@skjnldsv