Skip to content
Latchkey

zstd vs gzip: Faster CI Cache and Artifact Compression

zstd (Zstandard) generally gives better speed and compression ratio than gzip at comparable settings; gzip is older and available literally everywhere.

Compression directly affects CI cache save/restore and artifact upload time. zstd is a modern algorithm with strong speed/ratio trade-offs and tunable levels; gzip (DEFLATE) is the universal baseline that every tool understands.

zstdgzip
SpeedFaster at comparable ratiosBaseline
Compression ratioUsually better, tunable levelsDecent, limited tuning
UbiquityWidely available, sometimes needs installEverywhere by default
LevelsWide range (incl. very fast)Narrow range
Typical CI useCache/artifact compressionUniversal fallback

Where zstd wins

For large CI caches and artifacts, zstd typically compresses and decompresses faster than gzip while reaching a similar or better ratio, cutting cache save/restore time. Its wide level range lets you trade speed for size. Modern GitHub Actions cache tooling already favors zstd when available.

Where gzip wins

gzip is present on essentially every system and understood by every tool and language runtime, so it is the safe default when you cannot guarantee zstd is installed or when a downstream consumer only accepts gzip. For small payloads the difference is negligible.

In CI

Prefer zstd for big caches and artifacts where save/restore time matters; the official Actions cache uses zstd automatically when present and falls back to gzip otherwise. Use gzip when universality or a fixed downstream format requires it.

The verdict

Use zstd for large CI caches and artifacts to cut compression time; fall back to gzip for universal compatibility or tiny payloads. For most pipeline caching, zstd is the faster default.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →