diff --git a/doc/conf.py b/doc/conf.py index b77dfa3ba85f..acb36254db82 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -397,7 +397,11 @@ def js_tag_with_cache_busting(js): "collapse_navigation": not is_release_build, "show_prev_next": False, "switcher": { - "json_url": "https://matplotlib.org/devdocs/_static/switcher.json", + # Add a unique query to the switcher.json url. This will be ignored by + # the server, but will be used as part of the key for caching by browsers + # so when we do a new minor release the switcher will update "promptly" on + # the stable and devdocs. + "json_url": f"https://matplotlib.org/devdocs/_static/switcher.json?{SHA}", "version_match": ( # The start version to show. This must be in switcher.json. # We either go to 'stable' or to 'devdocs'