From 3c400792aa9d3f63ad6b1fdeff3651c62ec0d60e Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Thu, 15 Aug 2024 07:35:59 +0530 Subject: [PATCH] Add no cache header for downloads from GCS --- routers/static_pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/static_pages.py b/routers/static_pages.py index d6e2301ae..0be54ada8 100644 --- a/routers/static_pages.py +++ b/routers/static_pages.py @@ -40,7 +40,7 @@ def serve_static_file(request: Request) -> Response | None: status_code=HTTP_308_PERMANENT_REDIRECT, ) html_url = bucket.blob(gcs_path + ".html").public_url - r = requests.get(html_url) + r = requests.get(html_url, headers={"Cache-Control": "no-cache"}) if r.ok: html = r.content.decode() # replace sign in button with user's name if logged in