How to compression level optimizer in developer workflows
- Step 1Reach for it during artifact review — When a PR changes a shipped ZIP/bundle, drop the built artifact into the optimizer to see whether the current level is the right one — no need to check out the branch.
- Step 2Benchmark the artifact (Pro) — Open /archive-tools/compression-level-optimizer on a Pro+ account, drop the build output (one file or many), and Process. It compresses at levels 1, 3, 6, 9 and times each.
- Step 3Compare 6 vs 9 against CI time — Read the
timeMsandsizerows. If level 9 saves a fraction of a percent for double the time, standardise on level 6 in the build config and note why in the PR. - Step 4Diff the winning artifact — Download the smallest ZIP and run Archive Diff against the previous release to confirm only the intended entries changed.
- Step 5Reproduce the engine in CI — There's no JAD API. To bake the chosen level into the pipeline, call
fflate'szipSync(map, { level })in a build script — the same function this tool uses. - Step 6Attest the build — Generate a SHA-256 manifest with Checksum Generator so downstream consumers can verify the artifact they received matches what CI produced.
Output fields mapped to a build decision
From optimizeLevels in lib/archive/archive-processor.ts. The JSON shape is exact; the interpretation is the dev workflow.
| Field | Dev meaning | Typical action |
|---|---|---|
results[].size | Artifact bytes at that level | Pick the smallest you can afford to build |
results[].timeMs | CI compress cost (scaled) | Reject levels that blow the build budget |
results[].ratio | Savings vs source | Sanity-check the artifact is compressible at all |
bestLevel | Smallest of 1/3/6/9 | Default to 6 if 9's gain is trivial |
entryCount | Files in the bundle | Confirms all expected files were included |
Reproducing the result outside the browser
The browser tool has no API. These are real package/CLI equivalents, not JAD features.
| Goal | Equivalent | Note |
|---|---|---|
| Same DEFLATE level in CI | fflate (npm) zipSync(map,{level}) | Identical engine to this tool |
| Shell-level ZIP at a level | zip -N out.zip files | Standard DEFLATE; matches within header bytes |
| Every level 1–9 | zip loop | Tool tests only 1/3/6/9 |
| Non-DEFLATE engine | 7z, zstd, brotli CLIs | Out of scope for this tool |
| Build artifact diff | Archive Diff | Compare two archives entry-by-entry |
Cookbook
Developer scenarios for tuning and reviewing build artifacts. JSON shapes match the tool's real output.
Frontend bundle: level 6 is the right CI default
Minified JS/CSS compresses well, but the jump from 6 to 9 is marginal. The data justifies keeping CI at level 6.
Input: dist/ (5 files, 6.4 MB minified JS/CSS)
{
"originalSize": 6710886,
"results": [
{ "level": 1, "size": 2147483, "timeMs": 58, "ratio": "68.0%" },
{ "level": 3, "size": 1932735, "timeMs": 94, "ratio": "71.2%" },
{ "level": 6, "size": 1744830, "timeMs": 210, "ratio": "74.0%" },
{ "level": 9, "size": 1731517, "timeMs": 405, "ratio": "74.2%" }
],
"bestLevel": 9
}
PR comment: "L9 saves 13 KB for ~2x build time -> keep L6."Source tarball: level 9 actually pays off
For a download-once-many-times source distribution, the extra build time is amortised across thousands of downloads, so the smallest size wins.
Input: project source tree (820 files, 18 MB)
{
"originalSize": 18874368,
"results": [
{ "level": 1, "size": 6291456, "timeMs": 240, "ratio": "66.7%" },
{ "level": 6, "size": 4404019, "timeMs": 980, "ratio": "76.7%" },
{ "level": 9, "size": 4089446, "timeMs": 1850, "ratio": "78.3%" }
],
"bestLevel": 9
}
Decision: published once, downloaded often -> ship level 9.Wasm/binary asset: don't expect much
Compiled binaries compress modestly. The table prevents a false expectation that level 9 will dramatically shrink a .wasm.
Input: app.wasm, 9 MB
{
"originalSize": 9437184,
"results": [
{ "level": 1, "size": 6606028, "timeMs": 70, "ratio": "30.0%" },
{ "level": 6, "size": 5945625, "timeMs": 260, "ratio": "37.0%" },
{ "level": 9, "size": 5849907, "timeMs": 520, "ratio": "38.0%" }
],
"bestLevel": 9
}
Lesson: ~38% at best — set expectations in the PR accordingly.Reproducing the chosen level in CI with fflate
Since there's no JAD API, bake the level into a build script using the identical engine.
// build-archive.mjs — same engine the tool uses
import { zipSync } from 'fflate';
import { readFileSync, writeFileSync } from 'node:fs';
const map = { 'app.js': new Uint8Array(readFileSync('dist/app.js')) };
const out = zipSync(map, { level: 6 }); // level chosen via the optimizer
writeFileSync('release.zip', out);Review loop: benchmark, diff, attest
A repeatable artifact-review sequence using the optimizer and two sibling tools.
1. Optimizer on PR artifact -> confirm level, get smallest ZIP
2. /archive-tools/archive-diff : new.zip vs prev release
-> only src/app.js and assets/logo.svg changed (expected)
3. /archive-tools/checksum-generator : SHA-256 manifest
-> attach to the release for consumer verificationEdge cases and what actually happens
Trying to call it from CI
Not supportedThere is no JAD API or CLI — archive tools run only in the browser. For pipelines, use the fflate npm package (the same engine) directly.
Developer on Free tier
Upgrade requiredThe tool is Pro-tier; Free accounts see an upgrade overlay. Use a Pro+ login to benchmark artifacts.
Wanting levels 2/4/5/7/8
By designOnly 1, 3, 6, 9 are tested. For a full 1–9 sweep, loop the zip CLI; the tool's level set is fixed in code.
Expecting brotli/zstd-grade compression
Not supportedDEFLATE/ZIP only. For web-delivery compression comparisons (brotli/zstd), use those tools' CLIs — this benchmarks ZIP level, not engine.
Artifact exceeds the size cap
RejectedBuilds over 500 MB (Pro) / 2 GB (Pro+Media/Developer) are blocked. Benchmark a representative module or sub-bundle instead.
Reproducibility expectation
CaveatZIP entries carry timestamps; the optimizer doesn't normalise them. For bit-identical artifacts, normalise timestamps in your own build (e.g. fflate's mtime) — there is no timestamp control in this tool's UI.
entryCount doesn't match expectations
DiagnosticentryCount equals the number of files you dropped. If it's lower than expected, you missed files in the selection — re-pick the full set.
Level 9 barely beats level 6
ExpectedCommon for already-minified assets. The honest call is usually level 6 for CI speed; the table makes the trivial gain explicit so the PR can justify it.
Downloaded artifact named .json
ExpectedThe smallest ZIP downloads as compression-levels.json. It's a valid ZIP — rename it or just unzip it; copy the on-screen JSON for the PR.
Frequently asked questions
Is there an API or CLI?
No — every JAD archive tool is browser-only with no server path. For automation, the closest equivalent is the fflate npm package, which exposes the same zipSync(map, { level }) this tool calls.
Which levels does it benchmark?
DEFLATE 1, 3, 6 and 9 only — a fixed set. For every level 1–9, script a zip loop.
Will the browser result match my CI build?
If CI uses fflate at the same level, yes — to within a few header bytes. zip/gzip at the same level also match closely since all use standard DEFLATE.
How do I make the artifact reproducible?
This tool doesn't normalise timestamps. Set a fixed mtime in your own fflate build (or your build system) so the bytes are stable across machines, then verify with Checksum Generator.
Can I batch many artifacts?
One bundle per run here. For bulk size/ratio reporting across many archives, use Batch Compression Report.
Does it support brotli or zstd?
No. It's DEFLATE/ZIP only. Use the respective CLIs for brotli/zstd web-delivery comparisons.
What do I actually download?
The smallest ZIP among the four levels, saved as compression-levels.json. The metrics JSON itself is shown on screen — copy it for your PR.
How do I diff before/after artifacts?
Use Archive Diff to compare the new archive against the previous release entry-by-entry.
Is it free for developers?
No — it's Pro-tier. Free accounts can't run it; Pro, Pro+Media and Developer can.
Does dropping a folder work?
This tool isn't a folder picker — it takes individual files (multiple allowed). To zip a whole folder, use Folder to ZIP, then benchmark or build with a level there.
How do I commit to the chosen level in-browser?
Use Smart Archive Compressor, which has an explicit 0–9 level control, to build the real archive at the level the optimizer recommended.
Why does my .wasm/.png barely compress?
Compiled binaries and already-compressed images have little redundancy for DEFLATE to exploit. The ratio column reflects that honestly — don't expect level 9 to fix it.
Privacy first
Every JAD Archive tool runs entirely in your browser using fflate, @zip.js/zip.js, and the libarchive WASM bridge. Your archives never leave your device — verified by zero outbound network requests during processing.