Skip to content

[6.x] Fix performance issue when duplicating entries in large collections - #14995

Merged
jasonvarga merged 2 commits into
6.xfrom
duplicate-entry-slug-query
Jul 13, 2026
Merged

[6.x] Fix performance issue when duplicating entries in large collections#14995
jasonvarga merged 2 commits into
6.xfrom
duplicate-entry-slug-query

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where duplicating an entry in a large collection (especially multisite, with many entries per site) could result in a 504 Gateway Timeout.

This was happening because the slug uniqueness check in DuplicateEntry::generateTitleAndSlug() queried entries by locale, which isn't a registered Stache index. Since nothing else in the codebase queries entries by locale, that index was never warmed, so the first time it was needed it had to hydrate every entry file in the collection (across all sites) from disk just to build it.

This PR fixes it by querying by site instead, which holds the same values but is already a registered Stache index that's warmed by normal Control Panel usage (like viewing a collection's entry listing), making the check effectively instant in practice.

Fixes#14992

duncanmccleanand others added 2 commits July 13, 2026 14:16
The slug uniqueness check queried by `locale`, which isn't a registered
Stache index for entries. On first use it required hydrating every
entry file in the collection across all sites to build an ad-hoc
index, causing timeouts on large collections. Querying by `site`
instead reuses the index that's already warmed by normal CP traffic
(e.g. collection listings).
@jasonvarga
jasonvarga merged commit 4be20a7 into 6.xJul 13, 2026
22 checks passed
@jasonvarga
jasonvarga deleted the duplicate-entry-slug-query branch July 13, 2026 18:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate action: possible performance issue

2 participants

@duncanmcclean@jasonvarga