Expand description
Content-hashed static assets.
Hashing happens at build time, in generate, not when the server
starts. At runtime this module only reads the manifest that build produced
and applies the two cache-control policies: hashed URLs are immutable for a
year, everything else is never cached.
Re-exports§
pub use generate::FAVICON_DIRECTORY;pub use generate::FAVICON_PNG_SOURCE;pub use generate::FAVICON_SVG_SOURCE;pub use generate::Phase;pub use generate::STATIC_DIRECTORY;pub use generate::generate_static_assets;pub use icons::DERIVED;pub use icons::IconSource;pub use icons::SOURCE_PNG_SIZE;pub use icons::dimensions;pub use icons::resolve_source;
Modules§
- generate
- The build-time static-asset pipeline.
- icons
- The icon set, rendered from the one icon a project authors.
Structs§
- Cache
Buster - Resolves a logical asset path to its content-hashed one.
- Manifest
- A logical-path to hashed-path map.
Enums§
- Cache
Buster Error - Why the asset cache could not be built.
Constants§
- MANIFEST_
PATH - Where the JSON manifest is written, relative to the project root.
- TYPESCRIPT_
MODULE_ PATH - Where the generated TypeScript module is written.
Functions§
- content_
modified - The newest modification time across everything that determines page output.
- probe_
social_ image - Reads
path’s dimensions and MIME type. - validate_
declared - Checks that every declared asset is in the manifest.
- validate_
icons - Checks the icon set: one source, and every derived file present and exactly the size it claims to be.