Prompt

How do I use a CDN to resize images on the fly?

Technology / CDN & Edge Infrastructure1 observationLast seen Nov 2, 2026

Latest observation

Nov 2, 2026OpenAI APIWeb search: off

To resize images on the fly with a CDN, you usually use the CDN’s image transformation feature. The basic idea is:

  1. Store the original image on your origin server or object storage.
  2. Request the image through the CDN with resize parameters in the URL.
  3. The CDN fetches the original, resizes it at the edge, caches the result, and serves the transformed image.

Typical flow

Original image:

  • https://origin.example.com/images/photo.jpg

CDN transformed URL:

  • https://cdn.example.com/images/photo.jpg?w=800&h=600&fit=crop

The CDN interprets the query parameters and returns a resized version.


Common resize options

Different CDNs use different syntax, but the usual options are:

  • w or width — target width
  • h or height — target height
  • fit — how to handle aspect ratio:
    • crop
    • contain
    • cover
    • fill
  • q or quality — compression quality
  • format — auto-convert to WebP/AVIF/JPEG/PNG
  • dpr — device pixel ratio for retina screens

Example:

  • ...?w=400&h=400&fit=crop&format=auto&q=80

Example with a CDN that supports transformations

Cloudflare Image Resizing

Example:

https://example.com/cdn-cgi/image/width=400,height=400,fit=cover,quality=80/images/photo.jpg

Imgix

Example:

https://your-source.imgix.net/images/photo.jpg?w=400&h=400&fit=crop&auto=format,compress

AWS CloudFront + Lambda@Edge / CloudFront Functions

You can:

  • attach a function that rewrites URLs
  • send requests to an image-processing service
  • cache the output at the CDN

Akamai / Fastly

These often support image optimization rules or edge image processing features.


Best practices

  • Keep originals untouched and high quality.
  • Use caching so the CDN doesn’t resize every request.
  • Use responsive images with srcset and sizes.
  • Prefer auto format conversion (WebP / AVIF) if supported.
  • Set cache-control headers appropriately.
  • Use signed URLs if you want to prevent abuse.
  • Make sure the CDN whitelists only your origin to avoid open proxy issues.

HTML example with responsive images

<img
  src="https://cdn.example.com/images/photo.jpg?w=800"
  srcset="
    https://cdn.example.com/images/photo.jpg?w=400 400w,
    https://cdn.example.com/images/photo.jpg?w=800 800w,
    https://cdn.example.com/images/photo.jpg?w=1200 1200w
  "
  sizes="(max-width: 600px) 400px, 800px"
  alt="Example photo"
/>

If your CDN does not support resizing directly

You can still do it by:

  • putting an image resizing service behind the CDN
  • using a serverless function or edge function to transform images
  • caching the transformed output at the CDN

A simple implementation plan

  1. Upload originals to S3, R2, or your server.
  2. Put a CDN in front.
  3. Enable image transformation.
  4. Use URL parameters to request sizes.
  5. Serve responsive variants in your frontend.
  6. Verify caching and image quality.

If you tell me which CDN you’re using — Cloudflare, CloudFront, Fastly, Akamai, Imgix, etc. — I can show the exact URL format and setup steps.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.