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

Cache getSharedWith() result #972

Merged
merged 1 commit into from
Apr 3, 2022
Merged

Conversation

ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Mar 17, 2022

The idea is to cache the result from getSharedWith() which can be requested multiple times (at least 4) when loading a new page on Files App.

Each cache is identified by a key based on:

  • the singleId of the initiator,
  • the nodeId of the request, can be 0
  • the checksum of the Probe object.

The cache related to the singleId of the membership is reset when membership is updated.
All the cache is clear when creating/editing/deleting a share. (It might be interesting to filter the memberships affected by the share)

@ArtificialOwl ArtificialOwl force-pushed the enh/noid/cache-share-request branch 2 times, most recently from 8450e17 to 55b21aa Compare March 20, 2022 12:34
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/cache-share-request branch from 55b21aa to bbc52d3 Compare March 29, 2022 22:27
@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2022

Codecov Report

Merging #972 (15d81a6) into master (c4a4e85) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##             master    #972      +/-   ##
===========================================
- Coverage      0.69%   0.69%   -0.01%     
- Complexity     5708    5716       +8     
===========================================
  Files           289     289              
  Lines         19740   19763      +23     
===========================================
  Hits            138     138              
- Misses        19602   19625      +23     
Impacted Files Coverage Δ
lib/Db/ShareWrapperRequest.php 0.00% <0.00%> (ø)
lib/FederatedItems/Files/FileShare.php 0.00% <ø> (ø)
lib/Listeners/Files/DestroyingCircle.php 0.00% <0.00%> (ø)
lib/Listeners/Files/MembershipsRemoved.php 0.00% <0.00%> (ø)
lib/Model/FileCacheWrapper.php 0.00% <0.00%> (ø)
lib/Model/Probes/CircleProbe.php 8.69% <0.00%> (-0.20%) ⬇️
lib/Service/MaintenanceService.php 0.00% <0.00%> (ø)
lib/Service/MembershipService.php 0.00% <0.00%> (ø)
lib/Service/ShareWrapperService.php 0.00% <0.00%> (ø)
lib/Tools/Traits/TDeserialize.php 9.52% <0.00%> (-1.59%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4a4e85...15d81a6. Read the comment docs.

@ArtificialOwl ArtificialOwl force-pushed the enh/noid/cache-share-request branch from bbc52d3 to 46b0f4f Compare March 31, 2022 20:41
Copy link
Member

@CarlSchwan CarlSchwan left a comment

Choose a reason for hiding this comment

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

Looks good

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/cache-share-request branch from 50e0018 to 15d81a6 Compare April 2, 2022 12:21
@ArtificialOwl
Copy link
Member Author

squashed

@ArtificialOwl ArtificialOwl merged commit 24d51bd into master Apr 3, 2022
@delete-merged-branch delete-merged-branch bot deleted the enh/noid/cache-share-request branch April 3, 2022 11:53
@icewind1991
Copy link
Member

Caching the shares also caches the file metadata of the root of the share. Breaking sync as the old etag will be reported after a change for the duration of the cache ttl.

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.

4 participants