Inline blur-up placeholders (LQIP): JPEG beats WebP across a page
imageslqipperformancegzipnginxjpegwebp
A low-quality image placeholder (LQIP) is a tiny (~20 px wide) image inlined as a data URI and stretched with a blur while the real image loads. When many are inlined in one HTML page, JPEG is smaller on the wire than WebP even though each JPEG is about four times bigger.
The measurement
Measured on videos.jhampton.io, 95 cards with real posters (2026-08-14): - Per file: ~1,050 bytes as JPEG, ~220 bytes as WebP. - Gzipped across the whole page: 19 KB for JPEGs, 22 KB for WebPs.
Every JPEG repeats the same quantization and Huffman tables, so the files compress against each other. WebP output is already entropy-coded and incompressible. Measure the page, not the file, whenever many small images are inlined. With a single placeholder, or with no response compression, WebP wins outright.
Recipe
- ~20 px wide, JPEG quality ~45, stored on the record as a data URI.
- Generate it wherever the poster changes so the blur tracks the current frame (on the videos site: a canvas
tinyPreview()at upload time in the admin, and the CLI'sadd,lqip [slug|--all]andpostercommands). - Never generate one for encrypted/private media: a blurred frame is still a frame. Withhold it server-side regardless of what is stored.
- Confirm the server actually compresses HTML.
Server note: gzip is per site on the Alma box
New vhosts on the Alma Linux server (45.79.9.71) do not gzip by default. nginx gzip on is set per site in /etc/nginx/conf.d/<site>.conf; some sites have it and some do not (the videos site did not at first, and the main justinahampton.com vhost still ships its JS uncompressed). text/html is always compressed once gzip on is set and must not be listed in gzip_types (nginx warns about the duplicate).
See also
- nginx in front of Apache (TLS proxy on :8008)
- Encoding phone clips for the web (HEVC remux, H.264 fallback)
Linked from
- Caching static sites and unbundled ES modules (?v= stamps, no-cache, prefetch)
- Encoding phone clips for the web (HEVC remux, H.264 fallback)
- Resizing uploaded photos on the server (PHP GD)
- videos.jhampton.io (private video site architecture)
- Zero layout shift for network images in Flutter (dimensions in the URL)