Edge URLs & Transformations
The public CDN URL format, how stable and versioned URLs are cached, and every transform parameter you can append to resize, crop and convert images on the fly.
Public edge URL
The URL returned by the management API is what you embed in pages, newsletters, or apps. All clients fetch through the edge.
{edge-base}/1/{usageId}/{resourceId}/{params...}/{filename}[?query params]1- the API version prefix; part of the URL.usageId- customer-scoped token (allocated automatically on first resource creation).resourceId- returned byPOST /1/cdn/resources.params...- zero or more transform parameter segments (see Transform parameters); also accepted as query parameters. Path segments must be lowercase.filename- required as the last path segment.
Only GET is served; HEAD and other methods return 405.
Stable vs versioned URL
Every resource comes with two URLs:
Field | Shape | Cache-Control | Use when |
|---|---|---|---|
|
|
| Default. The URL is embedded once and must update in place when the source is replaced. Browsers revalidate hourly (a |
|
|
| Opt-in. Your platform re-fetches resource data from the API on every build or sync and re-deploys the new URL itself, so browsers can skip revalidation entirely. |
A versionedUrl whose version no longer matches (an old embed after a PUT, or a brand-new version that has not finished processing yet) still works: it serves the current bytes with the stable-URL header, never immutable. Old embeds never break. Transform parameters go before the v{version} segment or in the query string as usual.
Transform parameters
Both short (one-letter) and long names are supported, as path segments or query parameters. Query parameters take precedence over path parameters, which take precedence over the resource defaults. Path segments and their values must be lowercase; query keys are case-insensitive.
Name | Short | Type | Range | Default | Path example | Query example |
|---|---|---|---|---|---|---|
width | w | int | 0–10000 | 0 (unconstrained) |
|
|
height | h | int | 0–10000 | 0 (unconstrained) |
|
|
quality | q | int | 0–100 | 80 ( |
|
|
format | f | enum | webp, avif, jpeg ( | auto |
|
|
fit | fit | enum | cover, contain, scale-down | cover |
|
|
dpr | dpr | float | 0–5 | 1 ( |
|
|
zoom | z | percent | 100–1000 (values below 100 mean no zoom) | 100 |
|
|
focus point | fp | two floats 0–100 |
| none (resource |
|
|
region | rg | x,y,w,h percent | 0–100 each; | none |
|
|
background | bg | 6-char hex | - | none |
|
|
Output size is w/h × dpr, clamped to 10000 px on each side. EXIF orientation is applied and metadata is stripped on every transformed output.
Cropping: focus + zoom (fp/z) vs explicit region (rg)
Two ways to crop, in precedence order:
rg(region) - an explicit source rectangle asx,y,w,hpercentages (top-left origin). It carries position and extent, so it reproduces any editor crop, including off-aspect ones. When present,rgwins andfp/zare ignored. Output is the region resized tow/h(fit falls back tocontainso the selection is never re-cropped). Requiresw/h> 0; rejected with400if the region is empty or extends past 100 on either axis.fp+z-fppositions a crop window on a focus point;z(zoom percent, >100) shrinks that window to zoom into the source before resize. Centre + target aspect (w/h) +ztogether determine the rectangle. Example:fp70,37/w512/h207/z258zooms ~2.58× centred near the top-right.zwithoutfpzooms into the centre of the image.
z zooms the source region - it does not scale the output. Output size is always w/h (times dpr). When fp, z or rg is set together with both w and h, fit falls back to contain (if it was cover or unset) so the crop is fitted into the target box rather than re-cropped; an explicit scale-down is kept.
Fit modes
Mode | Behavior |
|---|---|
cover | Resize to cover the target area; crop excess. Default. With only one of |
contain | Fit inside the target area. Pads to the exact box with the |
scale-down | Like |
Format negotiation
When format is auto (or unspecified) the edge picks AVIF if the request's Accept header allows it, else WebP, else the format of the stored rendition (WebP for images), and caches each negotiated format as its own variant. Negotiation runs on transformed requests only: the resource defaults, path segments and query parameters are merged first, and if the result contains no transform the stored rendition is served unchanged.
GIF sources: the transform pipeline does not produce GIF, so the last step of negotiation falls back to PNG instead of the source format. PNG is lossless, so that response is larger than the AVIF or WebP rendition of the same image.
Response headers
Header | Value | Meaning |
|---|---|---|
Cache-Control |
| Stable URL: browsers hold an hour, shared caches a day, then revalidate |
Cache-Control |
|
|
Cache-Control |
| Every error response |
ETag |
| Transformed output / stored rendition served unchanged / non-image file. Changes whenever the version or the parameters change |
Vary |
| Set on transformed responses with negotiated format. It is not guaranteed to reach the client, but format variants are always cached separately, so do not depend on the header being present |
Content-Type |
| Resolved output format |
X-Cache |
| Cache state of the transformed variant; only on transformed |
Retry-After |
| On |
Last-Modified, Accept-Ranges | - | Untransformed and non-image files only; these also support |
Supports If-None-Match for 304 Not Modified on every response.
Edge status codes
Code | When |
|---|---|
200 | Served |
206 |
|
304 |
|
400 | Invalid or too-long id, missing filename, invalid parameter value |
404 | Unknown resource, deleted, or in |
405 | Any method other than |
415 | The stored file is not an image although its type says so |
503 + | Resource still processing, or the file is temporarily unavailable (retry) |
Edge URL examples
Fetching variants from the edge:
# No parameters - resource defaults apply; the stored WebP rendition if the resource has no defaults
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/hero.jpg
# Resize via query parameters
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/hero.jpg?w=800&h=600
# Resize via path parameters
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w800/h600/hero.jpg
# Format negotiation (Accept: image/avif preferred)
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w800/hero.jpg
Accept: image/avif,image/webp,*/*
# Contain with background padding
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/hero.jpg?w=500&h=500&fit=contain&bg=ffffff&f=webp
# Focus-point crop
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w300/h300/fp50,75/hero.jpg
# Focus-point crop with source zoom (~2.58x into the source around the focus point)
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w512/h207/fp70,37/z258/hero.jpg
# Explicit region crop (reproduces an editor crop; overrides fp/z)
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w500/rg50,20,39,35/hero.jpg
# High DPI
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w200/dpr2/hero.jpg
# Versioned URL with transforms (immutable while v1 is current)
GET https://eu1.cdn.mediaflow.com/1/qkrtzn/x8k2m4n6p0q3r5s7t9v1wa/w800/v1/hero.jpgMediaflow can change the edge host. Always read the edge URL from the API response - don't construct it client-side.