From 065a2a070fb0e6f9d2fc182b43fd7ff7e668d4bf Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 10 Jan 2023 09:59:50 -0500 Subject: [PATCH] enable fastly streaming miss for package urls https://docs.fastly.com/en/guides/streaming-miss --- terraform/file-hosting/vcl/files.vcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terraform/file-hosting/vcl/files.vcl b/terraform/file-hosting/vcl/files.vcl index 514fc818..8fb31dc7 100644 --- a/terraform/file-hosting/vcl/files.vcl +++ b/terraform/file-hosting/vcl/files.vcl @@ -116,6 +116,11 @@ sub vcl_fetch { set beresp.cacheable = true; } + # Enable Streaming miss for package URLS + if (req.url ~ "^/packages/[a-f0-9]{2}/[a-f0-9]{2}/[a-f0-9]{60}/") { + set beresp.do_stream = true; + } + # If we successfully got a 404 response from GCS for a Package URL restart # to check S3 for the file! if (req.restarts == 0 && req.backend == GCS && req.url ~ "^/packages/[a-f0-9]{2}/[a-f0-9]{2}/[a-f0-9]{60}/" && http_status_matches(beresp.status, "404")) {