Skip to main content
Convertly’s image CDN is designed for long-lived edge cache and deterministic URLs. This guide covers performance best practices and fixing origin fetch failures.

First request vs repeats

The first request for a new URL — a new file, width, or transform param — may take about one second while Convertly encodes that variant. Repeat requests for the same URL are typically ~20 ms from the global edge cache. In production, most traffic is cached; stable srcset widths and presets keep first-hit requests rare.

Cache keys and immutability

Every CDN URL is a contract:
The edge cache key includes path + query params + Accept + Save-Data + Client Hints when used. That means:
  • Changing w, format, or any transform param creates a new cache entry (by design).
  • Reusing the same URL always hits the same bytes — ideal for Cache-Control: immutable semantics.
  • Do not overwrite files in place if you need instant updates; upload a new fileId or purge.

Prefer new file IDs over in-place overwrites

Format negotiation

Use format=auto (SDK default) so modern browsers get AVIF/WebP and legacy clients get JPEG from one URL string. Convertly sets Vary: Accept — at most two encoded variants per transform URL. See Format & delivery.

Responsive delivery

  • Most sites: <ConvertlyImage> or srcset + sizes — see Responsive images.
  • Fluid layouts: ch=Width,Dpr — see Client Hints guide.
  • Art direction: <picture> with different w/h/gravity per breakpoint.
Include widths up to ~2× your layout size (or use dpr=2 with a fixed w — see Device pixel ratio).

Presets reduce mistakes

Named presets (hero, thumb, og-card) keep param sets consistent across teams and reduce accidental cache fragmentation from typos.

Purge strategy

Origin deliverability

Convertly fetches origin-backed URLs (/o/{slug}/…) over public HTTPS or private bucket credentials. If transforms fail or return errors, check the following.

Public HTTPS origins

Local dev: use Next.js localPassthrough or point the origin at a preview deploy or HTTPS tunnel — see Image CDN setup and Operations → Local development.

Private bucket origins (S3, R2, GCS, Azure)

Examples for R2, GCS, and Azure.

Common error patterns

Smart crop cost

gravity=smart and gravity=face run analysis on cache miss only. Popular URLs pay once, then serve from edge indefinitely. For zero per-request analysis, persist focal points from POST /api/images/analyze and render with fp=x,y.

Security vs performance

  • public namespaces: fastest path — embed URLs directly in HTML.
  • signed / private endpoints: every URL needs server-side signing. Plan for sign API latency at render time, not per browser request, and cache signed URLs until exp when appropriate.
See Delivery access modes.
Last modified on July 17, 2026