From 1d56bdfdd7e7bb5db24503246c1c5244bc55fed0 Mon Sep 17 00:00:00 2001 From: n9k Date: Thu, 14 Jul 2022 16:49:57 +0000 Subject: [PATCH] Ensure browsers revalidate style.css & anonstream.js --- anonstream/routes/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/anonstream/routes/core.py b/anonstream/routes/core.py index 71fc1c6..ce2ef5c 100644 --- a/anonstream/routes/core.py +++ b/anonstream/routes/core.py @@ -140,4 +140,7 @@ async def access(timestamp, user_or_token): @etag_conditional @clean_cache_headers async def static(timestamp, user, filename): - return await send_from_directory(STATIC_DIRECTORY, filename) + response = await send_from_directory(STATIC_DIRECTORY, filename) + if filename in {'style.css', 'anonstream.js'}: + response.headers['Cache-Control'] = 'no-cache' + return response