CDN URLs & image variants
How addresses are built, and how to resize on the fly.
On this page
Every file has a public address:
publicId: 8 lowercase characters, the same for every file of your account. Get it fromGET /api/v1/meor the dashboard.path: the path you chose at upload, lowercased.
So your code can build the address instead of asking the API:
Custom domain. On plans that include it, point a CNAME (for example cdn.myserver.com) at cname.basix.media and add the domain in Dashboard → Domain. Files then also answer at https://cdn.myserver.com/<path>, without the publicId.
Caching. Files are served with Cache-Control: public, max-age=300, an ETag, Access-Control-Allow-Origin: * and range requests (video seeking works). After you replace a file, expect the new version everywhere within 5 minutes.
Missing images. If you set a placeholder image in Dashboard → Files, a missing image address under your publicId returns that placeholder instead of a 404.
Thumbnails and variants
Add ?w= (width) and/or ?f= (format) to an image address on cdn.basix.media:
- Works on
.png,.jpg,.jpeg,.webp,.avif. GIF, video and audio are served as uploaded, the query is ignored. - Widths snap up to this ladder: 16, 32, 64, 96, 128, 160, 192, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1280, 1536, 2048.
?w=400gives 448. - Formats:
webp(default),jpeg(orjpg),png. - Images are never enlarged. The applied width is in the
X-Basix-Widthheader. - The original is never modified. Variants are generated on first request, then cached.
- An invalid value (for example
?w=abcor?f=gif) answers400. - Variants are only served on
cdn.basix.media, not on custom domains.
Try it on your own server
Create a free account and your API key is ready in about two minutes. 3 GB included, bandwidth never billed, no card needed.