Skip to content

Recompile a template edited after, or in the same second as, its cache - #93

Merged
papac merged 2 commits into
3.xfrom
fix-package
Oct 19, 2026
Merged

papac merged 2 commits into
3.xfrom
fix-package

Conversation

@papac

@papac papac commented Oct 19, 2026

Copy link
Copy Markdown
Member

Filesystem::isExpired() compared the template's mtime with the cache file's ATIME, strictly. Two faults: the atime moves on every read of the cache, so a render could make the cache look newer than a template edited afterwards; and mtimes are whole seconds, so a template saved again in the second it was compiled was never compiled again.

Compare with the cache's mtime and treat a tie as expired. A tie costs one extra compile, never a stale page.

papac added 2 commits October 19, 2026 07:24
Filesystem::isExpired() compared the template's mtime with the cache
file's ATIME, strictly. Two faults: the atime moves on every read of the
cache, so a render could make the cache look newer than a template edited
afterwards; and mtimes are whole seconds, so a template saved again in
the second it was compiled was never compiled again.

Compare with the cache's mtime and treat a tie as expired. A tie costs
one extra compile, never a stale page.
@papac
papac merged commit 098bc2e into 3.x Oct 19, 2026
8 checks passed
@papac
papac deleted the fix-package branch October 19, 2026 08:00
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.

1 participant