Firebase Hosting gzip: inspect the exact artifact

Delivery compression and REST upload hashes answer different questions. Keep the exact compressed bytes behind a manifest digest separate from the plaintext source.

The offline fixture retains two desired paths but queues only G2 for H2. Both original source strings were compressed locally, their retained gzip bytes hashed with SHA256, and decompressed back to the sources. The HTML shows those actual artifact records and checks a fictional required-hash set without calling Firebase.

Firebase Hosting gzip: inspect the exact artifact
Firebase Hosting gzip: inspect the exact artifact
Open the full example ↗

Work through the example

Required aliases H2 produce one queue entry, /style.css, while /index.html remains in the full manifest. Enter H1,H2 to queue both retained artifacts. H3 is unknown and holds the queue instead of inventing a body. The digest shown for each artifact describes its retained gzip bytes, not a recompressed substitute or the source text.

Retain each compressed artifact after hashing it and use those same bytes for any later authorized upload. Matching plaintext does not establish matching gzip bytes. The full desired-path manifest stays intact even when the required subset is smaller. Unknown aliases, missing artifacts or body-digest mismatches must stop queue acceptance before any network stage is considered.

Hash the retained compressed artifact

The REST deployment guide calls for SHA256 hashes of gzip-compressed files and a full desired-file manifest. The returned uploadRequiredHashes identifies the subset needing upload. Finalization and release are later, distinct steps. Firebase Hosting REST workflow.

The two retained local source/artifact pairs use these aliases:

Desired path Original source Retained gzip artifact Symbolic compressed-byte hash
/index.html Source S1 G1 H1 = SHA256(G1)
/style.css Source S2 G2 H2 = SHA256(G2)

S1 and S2 remain unchanged originals. G1 and G2 are separately retained compressed artifacts. H1 and H2 are readable aliases for the actual compressed-byte digests displayed in the example.

The raw HTML source's hash is not the definition of H1. H1 refers specifically to G1's compressed bytes. Keep source and artifact hashes in different fields so a preflight cannot accidentally substitute one for the other.

Keep the full manifest even when the queue is smaller

The original offline manifest describes both desired paths: /index.html maps to H1 and /style.css maps to H2. Now supply a fictional response fixture with uploadRequiredHashes = [H2].

The selected queue contains G2 only. The manifest still contains both paths. Do not remove /index.html merely because H1 is absent from the required set; the intended version and the pending bodies are different records.

Record Expected contents in this fixture
Full desired-path manifest /index.html → H1; /style.css → H2
Fictional required-hash set H2
Proposed body queue Exact retained G2 bytes
Actual remote upload result Not performed

H2's absence or presence in this authored fixture does not establish any actual server cache state. It exercises local queue selection only.

Do not recompress after choosing the hash

Retain the actual compressed artifact used to calculate H2. Before accepting the proposed queue entry, hash its body bytes again and compare them to that artifact's mapped digest. Recompression is a new artifact unless byte identity has been established.

The retained fixture check decompresses G1 and G2 and compares each result to the original source bytes. That check catches a wrong source/artifact pairing while preserving the originals. It does not prove successful transmission or release.

Hold inconsistencies before any network stage

Design the preflight to hold these original cases:

Condition Expected local outcome
Required set contains unknown H3 HOLD: no matching manifest artifact
Proposed G2 body digest differs from H2 HOLD: body identity mismatch
Duplicate desired path HOLD: ambiguous path mapping
Required artifact missing HOLD: body unavailable
Gzip cannot decode or decoded bytes differ from source HOLD: artifact/source mismatch

Recreate this example

Build one self-contained responsive HTML example titled “Firebase Hosting gzip: inspect the exact artifact” for readers completing the stated task. Return the complete HTML with embedded CSS and JavaScript. Use no remote fonts, libraries, images, requests, account connections, or saved-state claims.

Display these exact previously recorded manifest records:
{"path":"/index.html","alias":"H1","gzipArtifact":"G1","compressedBytes":77,"sha256":"e2c55d125631920949410dd3f1cacff2dc76f808975b35659f1bd5176ac4add8","decodedMatchesSource":true}
{"path":"/style.css","alias":"H2","gzipArtifact":"G2","compressedBytes":45,"sha256":"eb242f1383fcf2bea1a2d7320a466c2d68c946fc88ab29ea4702663ca93df627","decodedMatchesSource":true}
The lengths and digests refer to retained gzip bytes. Decompression equality is a previously recorded offline result, not a computation performed by the generated page. Keep alias H1/H2 clearly symbolic labels for those actual digests. Full desired manifest always contains both paths. Required-alias input starts H2; Check queue chooses exact retained artifacts; H1,H2 queues two; unknown H3 or duplicate aliases yields HOLD and no accepted queue. Label the offline evidence separately from generated queue output and keep remote stages unperformed. Explain delivery gzip/Brotli separately from REST compressed-byte hashes. No API, upload, finalization, release or deployment.

Use an artifact pipeline ledger with real retained compressed-byte hashes and symbolic required-set controls design with a compact header. Keep the actual sample data, controls, and useful default result visible early on a 360px-wide screen. Use readable text at least 16px, generous paragraph spacing, strong contrast, semantic labels, visible keyboard focus, and wrapping source blocks. Stack records on narrow screens rather than forcing a wide table.

Wire each action to an explicit type=button click handler using element selectors; the host permits scripts but blocks form submission. Update the visible result when the described action occurs. Show specific error feedback for invalid or missing input and clear stale feedback after dependent inputs change. Use plain text when displaying user values.

The required-hash set is fictional; local gzip checks are not Firebase upload, delivery or release evidence. Keep the source fixture and worked teacher or developer example distinct from actual user records. Include the domain-specific explanation and next check beside the result. Provide no fake download, send, deployment, approval, or persistence button. Everything operates locally for the current page session.

Review the prepared copy in NOS

Resolve each desired path to its retained gzip artifact before beginning an authorized deployment workflow. An HTML pipeline explanation can be rendered in NOS and its eligible static instructions revised visually. Keep source bytes, compressed hashes and eventual remote-stage evidence in the native deployment record.

Keep reading