Skip to content

Commit

Permalink
Pages: Also purge trailing slash (#2565)
Browse files Browse the repository at this point in the history
Fastly purge requests are sensitive to trailing slash, so to ensure we get the result we want we should also purge that.
  • Loading branch information
ewdurbin authored Sep 16, 2024
1 parent 4aa0d26 commit 0969d72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0969d72

Please sign in to comment.