From 499855d1b40cd7123ec9dcf80685f6e4f4ebe405 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 14 Aug 2025 19:45:07 +0200 Subject: [PATCH] Purge /dyncss/ when a css file is changed We serve combined CSS under that URL, so make sure it's purged along with the static CSS. --- tools/purgehook/purgehook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/purgehook/purgehook.py b/tools/purgehook/purgehook.py index 35e2127e..73550dc1 100755 --- a/tools/purgehook/purgehook.py +++ b/tools/purgehook/purgehook.py @@ -47,6 +47,10 @@ if __name__ == "__main__": curs.execute("SELECT varnish_purge('^/' || %(u)s || '$')", { 'u': l.strip(), }) + + # If it's a CSS file, we also need to purge /dyncss/ + if l.endswith('.css'): + curs.execute("SELECT varnish_purge('^/dyncss/')") elif l.startswith('data/'): # Data files map to xkeys with the same name as the file prefixed by data_ curs.execute("SELECT varnish_purge_xkey(%(key)s)", { -- 2.39.5