8000 Merge pull request #25286 from tacaswell/doc/cachebust_switcher · matplotlib/matplotlib@934951f · GitHub
[go: up one dir, main page]

Skip to content

Commit 934951f

Browse files
authored
Merge pull request #25286 from tacaswell/doc/cachebust_switcher
DOC: add cache-busting query to switcher json url
2 parents f16c00b + 1feb029 commit 934951f

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)
0