From 0969d7213ee012331fa05b12ca35c87fa60a4eb2 Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Mon, 16 Sep 2024 11:45:02 -0400 Subject: [PATCH] Pages: Also purge trailing slash (#2565) Fastly purge requests are sensitive to trailing slash, so to ensure we get the result we want we should also purge that. --- pages/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/models.py b/pages/models.py index 9b67997e1..c3973ce68 100644 --- a/pages/models.py +++ b/pages/models.py @@ -137,6 +137,8 @@ def purge_fastly_cache(sender, instance, **kwargs): Requires settings.FASTLY_API_KEY being set """ purge_url(f'/{instance.path}') + if not instance.path.endswith('/'): + purge_url(f'/{instance.path}/') def page_image_path(instance, filename):