Edge Image CDN
On-the-fly image optimization, resizing and delivery from globally distributed edge nodes. A single REST endpoint handles format negotiation, compression and cache invalidation.
Base URL
https://cdn-edge.djrafik.ru/v1
All API requests must use HTTPS. Plain HTTP connections are rejected.
Authentication
All requests require a Bearer token in the Authorization header.
Authorization: Bearer <token>
Tokens are scoped to a single delivery zone. A missing or invalid token returns 401 Unauthorized.
Endpoints
Fetches the source image, strips metadata and re-encodes it to the most efficient format supported by the client (AVIF, WebP or JPEG) based on the Accept header.
Request body
{
"source": "https://origin.example/img/hero.jpg",
"quality": 82,
"strip": true
}
Response
{
"id": "img_01J9X3K2P7",
"url": "https://cdn-edge.djrafik.ru/c/01J9X3K2P7.avif",
"bytes": 48213,
"format": "avif"
}
Returns a resized variant of a previously stored asset. Width and height are clamped to the zone's configured maximums.
GET /v1/resize?id=img_01J9X3K2P7&w=640&h=360&fit=cover
Purges all cached variants for the given asset IDs across every edge location. Propagation completes within ~30 seconds.
{
"ids": ["img_01J9X3K2P7", "img_01J9X4M0QZ"]
}
{
"purged": 2,
"status": "scheduled"
}
Error codes
| HTTP | Code | Description |
|---|---|---|
| 400 | invalid_source | Source URL is missing or unreachable |
| 401 | unauthorized | Missing or invalid Bearer token |
| 413 | source_too_large | Source exceeds the 25 MB limit |
| 429 | rate_limited | Too many requests — see rate limits |
| 502 | origin_error | Upstream origin returned an error |
Rate limits
Limits apply per token, per minute:
POST /v1/optimize— 300 req / minGET /v1/resize— 1 200 req / minPOST /v1/purge— 30 req / min
Exceeded limits return 429 with a Retry-After header.
Changelog
Added AVIF encoding on the fast path and per-zone quality presets.
Reduced purge propagation time to under 30 seconds globally.
Introduced the fit=cover resize mode and smart cropping.