Skip to content

[6.x] Fix share_errors breaking nocache regions on successful responses#14729

Open
joshuablum wants to merge 2 commits into
6.xfrom
fix-share-errors-breaking-nocache-regions
Open

[6.x] Fix share_errors breaking nocache regions on successful responses#14729
joshuablum wants to merge 2 commits into
6.xfrom
fix-share-errors-breaking-nocache-regions

Conversation

@joshuablum
Copy link
Copy Markdown
Member

Fixes a bug where enabling static_caching.share_errors silently breaks {{ nocache }} regions on regular 200 responses when using half measure static caching.
Affected pages log Static cache region [...] not found on [URL]. Serving uncached response. on every request after the first, fall through to a full dynamic render, and lose the benefit of static caching. Funny thing is that the Control Panel still reports them as cached.

The fix is an early return from copyError() when $response->isSuccessful(). The shared error cache is only ever consumed by RendersHttpExceptions for actual 4xx/5xx exceptions, so successful responses have no reason to go through the shared error caching path.
The shared error behavior for genuine error responses is unchanged.

Closes #11700.

Related:

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 Cache - Region not found 500 error

1 participant