Skip to content

Commit 1feb029

Browse files
committed
DOC: add cache-busting query to switcher json url
This will ensure that the switcher is promptly updated when we push updates to the devdocs.
1 parent f8ffce6 commit 1feb029

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,11 @@ def js_tag_with_cache_busting(js):
442442
"collapse_navigation": not is_release_build,
443443
"show_prev_next": False,
444444
"switcher": {
445-
"json_url": "https://matplotlib.org/devdocs/_static/switcher.json",
445+
# Add a unique query to the switcher.json url. This will be ignored by
446+
# the server, but will be used as part of the key for caching by browsers
447+
# so when we do a new minor release the switcher will update "promptly" on
448+
# the stable and devdocs.
449+
"json_url": f"https://matplotlib.org/devdocs/_static/switcher.json?{SHA}",
446450
"version_match": (
447451
# The start version to show. This must be in switcher.json.
448452
# We either go to 'stable' or to 'devdocs'

0 commit comments

Comments
 (0)