Skip to content

Don't fill the pagination cache if there are no extra items - #62365

Merged
icewind1991 merged 2 commits into
masterfrom
paginate-dont-cache-unneeded
Aug 10, 2026
Merged

Don't fill the pagination cache if there are no extra items#62365
icewind1991 merged 2 commits into
masterfrom
paginate-dont-cache-unneeded

Conversation

@icewind1991

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Only store paginated items and return pagination headers if the requested folder has more than 1 page worth of items.

This prevents needlessly caching items in redis

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added this to the Nextcloud 35 milestone Jul 21, 2026
@icewind1991
icewind1991 requested a review from a team as a code owner July 21, 2026 12:59
@icewind1991
icewind1991 requested review from Altahrim, come-nc, nfebe and salmart-dev and removed request for a team July 21, 2026 12:59
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Jul 21, 2026
@icewind1991 icewind1991 changed the title Paginate dont cache unneeded Don't fill the pagination cache if there are no extra items Jul 22, 2026
Comment on lines +56 to +58
public function hasOthers(): bool {
return $this->hasOthers;
}

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.

It’s crazy, I was convinced it was not legal to name a property and a function exactly the same, but it appears it’s always been allowed by PHP…
Today I learned 💡

@icewind1991
icewind1991 merged commit 1e92a39 into master Aug 10, 2026
278 of 290 checks passed
@icewind1991
icewind1991 deleted the paginate-dont-cache-unneeded branch August 10, 2026 12:09
@icewind1991

Copy link
Copy Markdown
Member Author

/backport to stable34

@icewind1991

Copy link
Copy Markdown
Member Author

/backport to stable33

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

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants