cloudflare-soos 1.18.0

Helper tool for Cloudflare's enhanced HTTP/2 prioritization, which makes progressive JPEG images load faster
Documentation

Scan Offsets of Scans

Progressive JPEG parser for HTTP/2 parallel progressive streaming feature.

It scans a JPEG file looking for Start Of Scan markers. Computes optimal offsets for the cf-priority-change header to render "DC-only" and "good enough" progressive stages.

Building & usage

Install Rust 1.38 or later.

Examples

Examples give useful results only for progressive JPEG files.

cargo run --example scan -- image.jpg

Will show the scan script used to generate image.jpg.

cargo run --example cf-priority -- image.jpg

Will show Cloudflare's cf-priority (first line) and cf-priority-change (second line) headers with breakpoints for the image.jpg.

Header generator

cargo run -- image.jpg

Prints contents of the cf-priority-change header to stdout or an error to stderr.

cargo build --release

Makes ./target/release/soos-cf-priority executable.

The same can be done programmatically by using this crate as a library and calling soos::cf_priority_change_header(jpeg_bytes). Run cargo doc --open for details.