Build-time image processing works until the archive gets large. This note records the first test of moving source images to object storage with transformation on request.

The Problem

Hugo resizes every image during the build. On a site with a few hundred images, a full rebuild takes minutes instead of seconds, and most of that time is spent regenerating variants that already exist.

The Test

  • Upload full-resolution originals to R2.
  • Request width and format through URL parameters.
  • Keep the local pipeline for images used in the current article only.

Early Results

Good: build time dropped noticeably once the archive was excluded, and image URLs became predictable.

Bad: transformation on first request adds latency for the first visitor. Warming the cache after each publish appears necessary, which reintroduces a build step, just a smaller one.

Unknown: cost at traffic volumes I cannot yet predict. Zero egress fees is the reason this test exists.

Status
Ongoing. Not yet moved to production: the cache-warming step needs to be reliable before it replaces something that already works.

What I Would Do Differently

Start with the largest images only. Converting the whole archive at once made the test hard to interpret.

Related: How I Manage Images for Static Publishing

Related reading