Skip to content

[6.x] Reset Antlers interpolated variables between requests - #15815

Open
lazerg wants to merge 2 commits into
statamic:6.xfrom
lazerg:fix/issue-15814-reset-interpolated-variables
Open

lazerg wants to merge 2 commits into
statamic:6.xfrom
lazerg:fix/issue-15814-reset-interpolated-variables

Conversation

@lazerg

@lazerg lazerg commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

This pull request fixes an issue where long-running processes that render many Antlers views (SSG workers, Octane) get slower with every render.

The DocumentParser adds every interpolated region it sees to GlobalRuntimeState::$interpolatedVariables, and Environment::getValue() checks each string value in a condition against that whole list. resetGlobalState() clears the rest of the runtime state after each request but never this list, so it grows forever in a single process.

This PR fixes it by clearing it in resetGlobalState(). The render node cache is cleared at the same point, so templates get re-parsed and the list fills back up with what the next request needs.

Fixes #15814

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.

GlobalRuntimeState::$interpolatedVariables is never reset, so long-running Antlers renders slow down without bound

1 participant