Skip to content

[6.x] Wipe the static cache store before deleting files on flush - #15991

Merged
jasonvarga merged 2 commits into
statamic:6.xfrom
edalzell:fix-file-cacher-flush-order
Nov 23, 2026
Merged

jasonvarga merged 2 commits into
statamic:6.xfrom
edalzell:fix-file-cacher-flush-order

Conversation

@edalzell

Copy link
Copy Markdown
Contributor

Since #15861, FileCacher::flush() deletes the HTML files and then wipes the dedicated static_cache store. A page rendered in between keeps its HTML on disk but loses the nocache regions it just stored, so with rules: all any save can leave a page with empty {{ nocache }} placeholders until the next full flush.

flush() now clears the URL index and the store first, then deletes the files. The middleware writes the HTML before the nocache data, so a file that survives the flush was written after the wipe and still has its regions. The store is still wiped on invalidation, so #15861's behaviour is unchanged.

Closes #15983

@edalzell
edalzell marked this pull request as ready for review November 21, 2026 19:38
@jasonvarga
jasonvarga merged commit 5a0044c into statamic:6.x Nov 23, 2026
61 checks passed
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.

Nocache regions lost under the full static cache

2 participants