Skip to content

[6.x] Fix static cache invalidation outside of a request - #15909

Draft
edalzell wants to merge 5 commits into
statamic:6.xfrom
edalzell:fix/static-cache-queue-invalidation
Draft

edalzell wants to merge 5 commits into
statamic:6.xfrom
edalzell:fix/static-cache-queue-invalidation

Conversation

@edalzell

@edalzell edalzell commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Pages are tracked under the domain they were requested from, but invalidation resolves URLs in the current process. In a queue worker there's no request, so a relative site URL (/) resolves against APP_URL; if that differs at all from the real origin (e.g. http://localhost vs https://www.example.com), nothing is found and the page stays stale. sync only works because the CP request happens to share the frontend's origin.

Each site now records the domains it has been cached under (static-cache:site-domains), and invalidating a URL also checks every domain recorded for that URL's site. Other sites' domains are left alone. Background recache still only warms the domain the URL resolves to; matches under other recorded domains are invalidated instead, since those hosts come from request headers and shouldn't receive the recache token.

Closes #3291

This branch has not been deployed

No deployments
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.

Static Caching invalidator not working when running from the queue

1 participant