Expand description
hyperlane-plugin-static-files
High-performance static file serving plugin for Hyperlane with path-traversal
defense, Hyperlane FileExtension MIME detection, 64-way sharded hot-file
caching, .br/.gz precompressed sidecars, ETag/304, RFC 9110 Range
(206/416), and SPA fallback.
Structs§
- Static
Files Config - Configuration for
StaticFilesRuntimeandStaticFilesPlugin. - Static
Files Hook - Opt-in
ServerHookserving static assets onGET/HEADrequests under the configured mount prefix. - Static
Files Plugin - Process-wide
StaticFilesPluginsingleton storingStaticFilesRuntime. - Static
Files Runtime - Thread-safe static asset engine with 64-way sharded hot-file caching and security checks.
Constants§
- DEFAULT_
STATIC_ CACHE_ CONTROL - Default
Cache-Controlheader applied to served static files. - DEFAULT_
STATIC_ INDEX_ FILE - Default directory index filename.
- DEFAULT_
STATIC_ MAX_ CACHE_ BYTES - Default maximum total memory budget for the sharded hot-file cache (32 MiB).
- DEFAULT_
STATIC_ MAX_ FILE_ CACHE_ BYTES - Default maximum single file size eligible for in-memory hot caching (1 MiB).
- DEFAULT_
STATIC_ MOUNT_ PREFIX - Default URL mount prefix served by
crate::StaticFilesHook.
Functions§
- if_
none_ match_ matches - Checks whether an
If-None-Matchheader matchesetag(handling*, comma lists, andW/weak prefixes). - mime_
for_ path - Resolves the MIME
Content-Typestring forpathwith a zero-allocation fast table for common web assets. - parse_
byte_ range - Parses a single RFC 9110 byte
Rangeheader (bytes=start-end,bytes=start-,bytes=-suffix). - resolve_
safe_ path - Safely joins an untrusted relative URL path onto a canonicalized
root_dir, rejecting traversal and dotfiles.