Skip to content

perf: caching a bit missing avatars#13262

Merged
kesselb merged 1 commit into
nextcloud:mainfrom
madbob:issue_9073
Jul 8, 2026
Merged

perf: caching a bit missing avatars#13262
kesselb merged 1 commit into
nextcloud:mainfrom
madbob:issue_9073

Conversation

@madbob

@madbob madbob commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

AvatarsController::url() already caches missing contents for a full day, I've just added one hour cache also in AvatarsController::image().

Comments about the interval are welcome: one hour, as suggested in #9073, or one day, as in AvatarsController::url()?

Fixes #9073

Signed-off-by: Roberto Guido <info@madbob.org>
@madbob madbob requested a review from GretaD as a code owner July 8, 2026 07:34
@kesselb

kesselb commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for your PR 👍

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

No bugs or security issues found. Looks good to me.

Changes:

  • Add a 1-hour HTTP cache (cacheFor(60 * 60, false, true)) for 404 Not Found responses from AvatarsController::image().
  • Update the corresponding unit test expectation to match the new caching behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/Controller/AvatarsController.php Applies 1-hour caching to negative (404) avatar image responses to reduce repeated lookups.
tests/Unit/Controller/AvatarControllerTest.php Adjusts the testGetImageNotFound expected response caching to the new 1-hour value.

@kesselb kesselb merged commit a406c97 into nextcloud:main Jul 8, 2026
43 checks passed
@kesselb

kesselb commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/backport to stable5.10

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.

Add HTTP cache on missing avatar

4 participants