Cookies publicitaires

Nous utilisons des cookies publicitaires pour mesurer l'efficacité de nos campagnes. Vous pouvez les refuser sans que cela affecte votre navigation. En savoir plus

Resources · Guides

Why format=auto should never end up in a cached page

An image reachable through a single URL, whose format changes depending on the visitor: that's what format=auto allows, and exactly what should never end up in a cached page. How ImagePipe protects against this by default, and the trap that remains if you build your own integration.

Illustration: a clock, symbolizing the trap of freezing an image format inside a cached page August 13, 2026

Technically, format=auto makes the ImagePipe engine resolve the final format (AVIF, WebP, JPEG…) from the Accept header sent by the browser at request time, then caches the generated variant with a very long Cache-Control (immutable, one year). Fine for a single real visitor, but dangerous once that same URL gets reused for several different visitors.

The concrete risk: a cached HTML page (WordPress page cache, CDN, proxy) containing a format=auto URL freezes the format resolved at the moment THAT request filled the cache, potentially a search engine crawler or a cache warmer with no AVIF support, then serves that same frozen format to every subsequent visitor of that page, including those whose browser doesn't support it.

ImagePipe protects against this by design on its official integrations: the Gutenberg block and the WordPress shortcode render a real <picture> with one <source> per format, negotiation then happens when the browser loads the image, not when the page is generated. The API for custom themes deliberately defaults to webp rather than auto, precisely to avoid freezing a format into a URL meant to be reused.

If you call ImagePipe's low-level API directly, a custom theme, a bespoke integration, one simple rule to remember: never pass format=auto on a URL meant to be injected into cached HTML or served to multiple visitors. Prefer a <picture>/<source> for real browser-side negotiation, or an explicit fixed format if you only need a single <img>.

Back to guides