Transforms
Resize, crop, format, and optimize images on the fly via URL parameters.
Width800
Height600
Quality85
https://media.fastpic.pro/42d00a45-e45b-405a-950b-88929d855b9a?w=800&h=600&q=85&fmt=auto&fit=coverHow transforms work
When you request media.fastpic.pro/{publicId}?w=800&fmt=webp, the media-proxy fetches the original from storage, applies the transforms with Sharp, and streams the result to the browser. Transformed images are cached at the edge, so repeated requests are served from CDN.
Parameters reference
| Param | Values | Description |
|---|---|---|
| w | 1-2000 | Output width in pixels. |
| h | 1-2000 | Output height in pixels. |
| q | 1-100 | JPEG/WebP encoder quality, where 100 is lossless. |
| fmt | auto, webp, jpeg, png, avif | Output format. auto picks based on the Accept header (modern browsers get WebP/AVIF). |
| fit | cover, contain, inside, outside | How to scale the image to fit width/height. cover crops to fill, contain shrinks to fit, inside shrinks but never up-scales, outside grows to fill. |
Examples
thumb.ts
// Resize to 800px wide WebP at 85% qualityconst src = 'https://media.fastpic.pro/img_a1b2c3d4?w=800&fmt=webp&q=85'Caching
All transformed images include Cache-Control headers (max-age=2592000, public). Once Cloudflare CDN is in front of media.fastpic.pro (deferred MVP-1), repeated transforms hit the edge cache and never touch our origin.