# Resize to 800x600, crop to fill, convert to WebP, quality 85%
curl "http://localhost:7100/cdn/avatars/user-99.jpg?w=800&h=600&fit=cover&f=webp&q=85"DevCloudDesk Storage Server processes image transformations dynamically on demand. When an asset is requested with transformation parameters, the server reads the original image, performs the requested transformations using multi-threaded libvips, caches the result to disk, and serves the response.
Subsequent requests for the exact same parameters are served directly from the local disk cache in under 2ms without re-processing.
Supported URL Formats#
You can use either query parameters or clean path tokens under the universal /cdn/ endpoint:
1. Path Token Style (/cdn/<transformations>/<path>)
texthttps://storage.yourdomain.com/cdn/w_600,h_400,c_fill,f_webp,q_80/products/shoe.webp
2. Query Parameter Style (/cdn/<path>?<params>)
texthttps://storage.yourdomain.com/cdn/products/shoe.jpg?w=600&h=400&fit=cover&f=webp&q=80
(Note: Legacy Cloudinary paths like /image/upload/* and /storage/* are also supported for seamless drop-in migration).
Both formats execute identical image operations and share the same underlying cache.
Transformation Parameters Reference#
| Parameter | Aliases | Allowed Values | Default | Description |
|---|---|---|---|---|
| Width | w, width, w_ | 1 to 4000 | Original width | Target width in pixels. |
| Height | h, height, h_ | 1 to 4000 | Original height | Target height in pixels. |
| Crop Mode | fit, crop, c_ | cover, contain, fill, inside, outside | cover | How the image fits into the target dimensions. |
| Format | f, format, f_ | webp, avif, jpeg, png, auto | Original format | Desired output image format. |
| Quality | q, quality, q_ | 1 to 100 | 80 | Compression quality level. |
| Blur | blur, e_blur_ | 1 to 100 | None | Applies Gaussian blur with the specified radius. |
Crop Modes (fit / crop) Explained#
cover(Default): Resizes the image to fill the target width and height completely while maintaining aspect ratio, cropping overflow from the center. Ideal for avatars, banners, and product cards.contain: Resizes the image to fit entirely inside the target bounding box without cropping. Transparent padding is added if aspect ratio differs.fill: Forces the image to the exact width and height specified by stretching or squeezing. Aspect ratio is not preserved.inside: Downscales the image so its dimensions are less than or equal to the target width and height without cropping.outside: Scales the image so its dimensions are greater than or equal to the target width and height.
Automatic WebP/AVIF Negotiation (f=auto)#
When you request f=auto (or pass f_auto in the path):
- The server inspects the incoming browser request's
AcceptHTTP header. - If the browser supports AVIF (
image/avif), it serves AVIF (highest compression). - If the browser supports WebP (
image/webp), it serves WebP (supported by 97%+ of browsers). - If neither is supported (rare), it falls back to optimized JPEG or PNG.
- The response includes
Vary: Acceptheader so downstream CDNs (Cloudflare, Fastly) cache the correct format per client.
How Caching Works#
textIncoming Request (/cdn/photo.jpg?w=400&f=webp) │ Is variant in disk cache? / \ YES NO / \ Return cached file Read original asset with 200 / 304 Run Sharp transform (Response: ~1-2ms) Save to disk cache Return 200 OK (Response: ~30-60ms)
- HTTP 304 Not Modified: If the client sends an
If-None-Matchheader matching the cached variant'sETag, the server immediately responds with304 Not Modifiedand zero body bytes. - Cache Eviction: When the cache reaches
CACHE_MAX_SIZE_GB(default 5GB), an automated LRU (Least Recently Used) cleanup prunes oldest unused variants to keep disk usage strictly bounded.
Next Steps#
- Signed Uploads →: Generate time-limited tokens for browser and mobile uploads.
- Client SDK URL Builder →: Generate transformed URLs programmatically in Node.js and Python.
- REST API Reference →: View raw HTTP endpoints.