Serve small binary assets direct from edge
Serve binary objects, such as images, directly from edge configuration.
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:
- Rust
Cargo.toml
Rust
[dependencies]fastly = "0.7.0"
main.rs
Rust
// The flag of the Netherlands let image: &[u8] = include_bytes!("nl.gif"); Ok(Response::from_body(image).with_content_type(mime::IMAGE_GIF))