Purge the release notes cache when a minor version is updated
authorJonathan S. Katz <jonathan.katz@excoventures.com>
Thu, 9 Feb 2023 17:57:04 +0000 (12:57 -0500)
committerJonathan S. Katz <jonathan.katz@excoventures.com>
Thu, 9 Feb 2023 17:57:04 +0000 (12:57 -0500)
Typically this required a user (especially the committer) to
manually do this step, which was easily and often missed. This
limits user error and ensures the release notes are available
to users in a timely manner.

Reviewed-by: Magnus Hagander <magnus@hagander.net>
pgweb/core/models.py

index 317031d1c5c09c463de71a5ea8e53481de0c3dad..2ef2692b027de4be8f5e9a625c884af1f92dc9aa 100644 (file)
@@ -99,6 +99,12 @@ class Version(models.Model):
         yield '/about/featurematrix/$'
         yield '/versions.rss'
         yield '/versions.json'
+        # the next two purge the cache for the release notes.
+        # note that we need to purge all the release notes for a major version
+        # tree as we currently have a sidebar that links to all of the minor
+        # versions within a tree on an individual release notes page.
+        yield '/docs/release/{:.0f}'.format(self.tree)
+        yield '/docs/release/$'
 
     def purge_xkeys(self):
         yield 'pgdocs_all'