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

Asset sha hashing #133

Closed
piercefreeman opened this issue Oct 5, 2024 · 0 comments
Closed

Asset sha hashing #133

piercefreeman opened this issue Oct 5, 2024 · 0 comments

Comments

@piercefreeman
Copy link
Owner

piercefreeman commented Oct 5, 2024

We should support server-side invalidation of client style files while still maximizing cache hits.

When importing local dependencies with a LinkAttribute, we should hash the contents at build-time so we can reference a dynamic sha in the injected URL. This will require:

  • Traverse any mounted StaticFiles directories. Even if this is overridden by nginx at host-time we assume users will have mounted this programmatically during development.
  • Cache a new artifact file at build-time that maps the filename to the current sha
  • When a LinkAttribute is created at runtime (for either global scope or dynamic render scope) we will do a lookup of the global artifact and determine if we have a sha referenced. If so, we'll include it as a ?v={sha} query param.
  • This should be opt-out with a keyword param during LinkAttribute creation
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

No branches or pull requests

1 participant