Repository navigation
feat(assets): static asset cache optimizer, sri fingerprinter, and compression profiler - #34
Merged
Conversation
…mpression profiler
ATLURI0001
deleted the
feat/static-asset-pipeline-sri-and-compression
branch
November 21, 2026 01:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Architecture Topology & System Design
Problem Statement & Architectural Motivation
Modern web delivery requires static assets to be cached indefinitely via CDN edge points (
Cache-Control: public, max-age=31536000, immutable). To guarantee fresh updates without cache poisoning, assets must incorporate cryptographic content digests directly into filenames. Concurrently, security standards require W3C Subresource Integrity (SRI) hashes to prevent CDN supply chain tampering, alongside pre-compression profiling.Diagnostic & Mathematical Formulation
Content-Addressable Slug Generation:
$$\text{Digest}_8 = \text{hex}(\text{SHA256}(\text{data}))[0:8]$$ $\to$
Transforms
assets/app.jsassets/app.<digest8>.js.W3C Subresource Integrity (SRI):
$$\text{SRI} = \text{"sha384-"} \mathbin{\Vert} \text{Base64}(\text{SHA384}(\text{data}))$$
Byte Shannon Entropy & Compression Savings:
$$H(B) = -\sum_{i=0}^{255} p(b_i) \log_2(p(b_i))$$
$$\text{SavingsRatio} = 1.0 - \frac{S_{\text{gzip}}}{S_{\text{raw}}}$$ $\text{SavingsRatio} \ge 0.15$ are flagged
Assets with
is_compressible: true.Traversal Security Guard:
Relative paths are verified using
PurePosixPath; any parent directory breakouts (..) or absolute paths (/) are rejected withValueError.Component Verification & Telemetry
src/buildsite/asset_pipeline.py: Complete implementation ofAssetPipeline.tests/test_asset_pipeline.py: 6 automated tests verifying deterministic fingerprinting, traversal blocks, SRI format, entropy calculation, and manifest generation.