Skip to content

Add command to clear dav's photo cache - #52879

Merged
ChristophWurst merged 2 commits into
masterfrom
bug/noid/clear-dav-photo-cache
May 19, 2025
Merged

Add command to clear dav's photo cache#52879
ChristophWurst merged 2 commits into
masterfrom
bug/noid/clear-dav-photo-cache

Conversation

@kesselb

@kesselbkesselb commented May 15, 2025

Copy link
Copy Markdown
Contributor

Summary

Contacts is using a request like below to fetch the photo for a user from the vcard.

/remote.php/dav/addressbooks/users/alice/z-server-generated--system/Database:jane.vcf?photo

As fetching and parsing vcards might be expensive there's a cache for the photos in app-data. While there are event listeners in place to reset the cache for a vcard on update or delete, there might be still cases where it's helpful to clear the cache.

How to test:

  • Make sure you have some contacts
  • Open contacts
  • Check oc_filecache for paths like '%dav-photocache%'
  • Run the occ command
  • Check oc_filecache for paths like '%dav-photocache%'
  • Open contacts
  • Check oc_filecache for paths like '%dav-photocache%'

Backports:

Only the command, refactoring is for 32.

Checklist

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselbkesselb added this to the Nextcloud 32 milestone May 15, 2025
@kesselbkesselb self-assigned this May 15, 2025
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the bug/noid/clear-dav-photo-cache branch from f367139 to 3d1de79CompareMay 15, 2025 16:28
@kesselbkesselb added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 15, 2025
@kesselb
kesselb marked this pull request as ready for review May 15, 2025 16:46
@kesselb
kesselb requested review from Altahrim, ArtificialOwl and sorbaugh and removed request for a teamMay 15, 2025 16:46

@hamza221hamza221 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.

Tested and works

@ChristophWurst
ChristophWurst merged commit 80b21cd into masterMay 19, 2025
@ChristophWurst
ChristophWurst deleted the bug/noid/clear-dav-photo-cache branch May 19, 2025 16:10
@kesselb

Copy link
Copy Markdown
ContributorAuthor

/backport 8a1ae09 to stable31

@kesselb

Copy link
Copy Markdown
ContributorAuthor

/backport 8a1ae09 to stable30

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

Labels

3. to reviewWaiting for reviewsenhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@kesselb@ChristophWurst@hamza221@skjnldsv