Augur

agr.media

Unified image CDN with on-the-fly transforms via Sharp and Cloudflare edge caching.

agr.media

A stateless image CDN that optionally transforms images with Sharp and serves them through Cloudflare's edge cache. It replaces the per-client DNS image hosting pattern with a single unified endpoint.

  • Domain: agr.media

URL Pattern

https://agr.media/{clientDomain}/{folder}/{path}
https://agr.media/{clientDomain}/{folder}/{transforms}/{path}
SegmentDescription
clientDomainThe client's domain (e.g., example.com)
folderimages or media (only allowed folders)
transformsOptional comma-separated key_value pairs
pathFile path relative to the folder (may include subdirectories)

Transforms

KeyValuesExample
w1–4096w_800
h1–4096h_600
q1–100q_80
fauto, webp, avif, jpeg, pngf_webp
fitcover, contain, fill, inside, outsidefit_contain

Transforms are combinable: w_400,f_webp,q_80

Examples

# Original image (pass-through, no transforms)
https://agr.media/example.com/images/logo/hero.jpg

# Resize to 400px wide
https://agr.media/example.com/images/w_400/logo/hero.jpg

# Resize + convert to WebP
https://agr.media/example.com/images/w_400,f_webp/logo/hero.jpg

# Resize + quality adjustment
https://agr.media/example.com/images/w_800,q_60/logo/hero.jpg

Caching

LayerHeaderTTL
BrowserCache-Control: public, max-age=8640024 hours
Cloudflare edgeCloudflare-CDN-Cache-Control: max-age=3600, stale-while-revalidate=86400, stale-if-error=6048001 hour TTL, SWR/SIE
  • ETag is based on file size + mtime — revalidation works when source files change
  • Vary: Accept is set on transformed images for content negotiation
  • No immutable — images may be replaced at the same path
  • No origin disk cache — Cloudflare edge is the only cache layer

Design Decisions

  • Stateless containers — any container can handle any request, no shared state
  • In-flight deduplication — concurrent requests for the same transform coalesce into one Sharp operation
  • SVG loading blockedVipsForeignLoadSvg is disabled for security
  • Max input size — 50 MB per image