Skip to content

[6.x] Fix recache token leaking into pagination links - #15297

Open
lazerg wants to merge 1 commit into
statamic:6.xfrom
lazerg:fix/issue-15294-recache-token-pagination
Open

[6.x] Fix recache token leaking into pagination links#15297
lazerg wants to merge 1 commit into
statamic:6.xfrom
lazerg:fix/issue-15294-recache-token-pagination

Conversation

@lazerg

@lazerg lazerg commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

With background recache enabled, pages rendered by a recache request emitted pagination links containing the __recache token, and that HTML got written to the static cache, so the token was served to everyone until the page was regenerated by an ordinary request.

The paginator's withQueryString() appended the raw request query string, token included. It also bypassed Laravel's Paginator::queryStringResolver(), so the usual way of filtering pagination query params never got called. It now goes through the resolver and drops the recache token.

Fixes #15294

@lazerg

lazerg commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

The red Windows shard is Tests\UpdateScripts\UpdateGlobalVariablesTest, which asserts the order of the sites array. That order comes from the Stache index, and nothing here touches it. The remaining Windows shards show as failed because fail-fast cancelled them.

@duncanmcclean

Copy link
Copy Markdown
Member

I've just re-ran the Windows tests and they seem to be passing now. I've opened #15298 to fix the flakey test.

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.

Background recache token (__recache) leaks into pagination links and is baked into the static cache

2 participants