From 6ccb155c9c2dc68c718d093a343e16e8049564c1 Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Mon, 16 Sep 2024 11:13:36 -0400 Subject: [PATCH] Pages: Also purge trailing slash 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):