JS & SSR Engineering Playbook Updated 2026-11-16 3 min read CDN Edge · Google Images · Cache

CDN On-The-Fly Image Resizing: Vary Headers, Clean URLs & Cache Efficiency

Misconfigured Vary headers and session-randomized image query strings fragment CDN caches and confuse Googlebot Image canonicalization.

Dmitry K., Technical SEO Lead · SEO Space

Indexation benchmark targets

Cache-Control
max-age=31536000, immutable
Vary safety
CDN-normalized Accept
URL stability
Deterministic paths

Preserving Google Images Indexing Through Image Resizing Proxies

On-the-fly image CDNs automatically convert PNG/JPEG masters to AVIF/WebP based on browser `Accept` headers. However, accidentally disallowing `/cdn-cgi/image/` or `/_next/image` in `robots.txt` blocks Googlebot Image from indexing product photography completely.

Furthermore, returning `Vary: User-Agent` explodes cache permutations and throttles edge hit rates for image bots.

  • Verify `robots.txt` explicitly permits your image transformation endpoint (`/media/`, `/_next/image`, `/cdn-cgi/image/`).
  • Use normalized `Accept` negotiation at the edge instead of `Vary: User-Agent`.
  • Emit `Cache-Control: public, max-age=31536000, immutable` on deterministic versioned image URLs.

Deterministic Width Presets Over Arbitrary Pixel Parameters

Constrain allowed transform widths (`480, 768, 1200, 1600`) so abusive bots cannot DoS your resizing workers with `?w=481`, `?w=482`, etc.

Cache-Control: public, max-age=31536000, immutable
X-Content-Type-Options: nosniff
Link: <https://cdn.example.com/images/valve-x200.jpg>; rel="canonical"

Image Proxy Hygiene Checklist

Keep image asset pipelines fast for browsers and unambiguous for Googlebot Image.

Setting Healthy Configuration Anti-Pattern
robots.txt path Allow resize proxy prefix Disallow: /_next/image
Width quantization Fixed breakpoint tiers Unbounded ?w=1..9999
File naming Descriptive kebab-case slug Opaque UUID hash without alt

Need this indexation setup audited on your domain?

Send your website URL. We check raw HTML parity, log crawl hits, canonical discipline, and sitemap architecture manually within 24 hours.