HTTP contract for on-demand image optimization.
Plug Options
:cache_control- response cache header (default:"public, max-age=31536000, immutable").:allowed_hosts- list of additional hosts allowed for absolutesrcvalues. Same-host requests are always allowed.
Query Params
src(required): absolutehttp/httpsURL or root-relative path.w(optional): positive integer width, max8192.h(optional): positive integer height, max8192.q(optional): quality in1..100.f(optional):webp|avif|jpg|png, defaults towebp.upscale(optional):true|false, defaults tofalse.
Responses
200with optimized binary body. May includex-phoenix-image-upscale: skippedwhen enlargement was clamped.400invalid parameters.403disallowed source host.404source not found upstream.500upstream or processing error.