Skip to content

[6.x] Scope shared static cache errors to sites#14763

Merged
jasonvarga merged 2 commits into
6.xfrom
per-site-shared-errors
Jun 2, 2026
Merged

[6.x] Scope shared static cache errors to sites#14763
jasonvarga merged 2 commits into
6.xfrom
per-site-shared-errors

Conversation

@joshuablum
Copy link
Copy Markdown
Member

#10294 introduced statically caching 404s when using half measure static caching. Additionally, it introduced a config setting that lets you share_errors which results in a single 404 page being served to all requests that result in a 404. The cache key generated in the fakeStaticCacheStatus request is not scoped to any site though but to /__shared-errors/{status}. When using multi-site this leads to whichever site/locale renders an error first "wins". Every site is then served that one site's 404 even when it's the wrong language, for example.

The fix is to namespace the cache key for each error page to the respective site.

Single-site installs are unaffected because the handle is just default so the behavior is unchanged.

The added test caches a shared error for one site and asserts a second site neither sees it nor has it overwritten as well as checking that each site retrieves its own error page.

@jasonvarga jasonvarga merged commit ee9c0c1 into 6.x Jun 2, 2026
19 checks passed
@jasonvarga jasonvarga deleted the per-site-shared-errors branch June 2, 2026 18:30
Sign up for free to 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.

2 participants