Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use timestamps for change detection #135

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Conversation

nwtnni
Copy link
Contributor

@nwtnni nwtnni commented Oct 2, 2023

This commit changes the caching mechanism to use the timestamp of all included templates instead of hashing the contents of the root template.

The primary downside is that every build now has to parse, transform, and resolve the input templates instead of just reading and hashing the data--I didn't measure how much more expensive this is, but it seems unavoidable if we need information about child templates. Maybe a hacky regex-based approach could work as an alternative to a complete parse.

On the bright side, this approach rebuilds parent templates correctly when a child template has changed, and doesn't require garbage collection for old compiled template files.

Checked correctness manually by setting CARGO_LOG=cargo::core::compiler::fingerprint=info.

Fixes #134 (maybe related to #132?).

This commit changes the caching mechanism to use the timestamp of
all included templates instead of hashing the contents of the
root template.

The primary downside is that every build now has to parse, transform,
and resolve the input templates instead of just reading and hashing
the data--I didn't measure how much more expensive this is, but it
seems unavoidable if we need information about child templates.
Maybe a hacky regex-based approach could work as an alternative to
a complete parse.

On the bright side, this approach rebuilds parent templates correctly
when a child template has changed, and doesn't require garbage collection
for old compiled template files.
@vthg2themax vthg2themax self-assigned this Oct 9, 2023
@vthg2themax vthg2themax merged commit 222a265 into rust-sailfish:main Oct 9, 2023
8 of 9 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.

Template cache is not busted when using include!
2 participants