Synthetic binary responses

Serve binary objects, such as images, directly from edge configuration by encoding them using Base64 encoding.

VCL

Use this solution in your VCL service (click RUN below to test this solution or clone it to make changes):

Compute@Edge

Use this solution in your Compute@Edge service:

  1. Rust
// The flag of the Netherlands
let image: &[u8] = include_bytes!("nl.gif");
Ok(Response::from_body(image).with_content_type(mime::IMAGE_GIF))