Back to Docs
Recipes

Image Optimization

Ship sharp, fast-loading images without manual pipeline work.

Automatic Format Selection

Meridian serves WebP to Chromium browsers and AVIF to Firefox. Drop a PNG or JPEG into your public/ folder and reference it normally. The CDN edge rewrites Accept headers on the fly — zero config.

Responsive Breakpoints

Append ?w= to any image URL. Meridian generates 640, 1080, and 1920 widths at build time and caches them at the edge. Combine with native srcSet for art-direction-free responsive images.

Lazy Loading Defaults

Every <img> served through the Meridian proxy receives loading="lazy" and explicit width/height attributes to prevent layout shift. No JavaScript intersection observer required.

BlurHash Placeholders

Pass a BlurHash string as the ?blur= query parameter. Meridian decodes it server-side and inlines the placeholder as a base64 data URI while the full image streams in.

Pro tip: Combine?w=1080&blur=LEHV6nWB2yk8pyo0adR*.7kCMdnjfor a buttery-smooth progressive load on hero images.