use fastly::http::header;
use fastly::{Error, Request, Response};
const BACKEND_NAME: &str = "origin_0";
#[fastly::main]
fn main(req: Request) -> Result<Response, Error> {
// Send request to backend
let mut resp = req.send(BACKEND_NAME)?;
// Cache-Control: no-store prevents browsers from writing the object to disk.
// We add 'private' in case there are any public caches downstream of Fastly,
// between us and the browser, which might perform request collapsing on public content
resp.set_header(header::CACHE_CONTROL, "private, no-store");
// Remove all other caching-related response headers
resp.remove_header(header::EXPIRES);
resp.remove_header(header::ETAG);
resp.remove_header(header::LAST_MODIFIED);
Ok(resp)
}