Changing the versions.json file often does not reflected in version menu for some time #8228
-
Hello after changing the versions.json file, e.g. adding a new version, and deploying the site it takes some time until the version is shown correctly in the selector drop-down list. The forwarding to new version is done like documented in mike and the URL is correct, but previous version is shown in the selector drop-down list. Steps to Reproduce
Expected Behavior
Additional ContextClear browser data or opening other browser or incognito mode solves the issue So the logic to load the version.json and create a drop-down menu must be somewere in the material design theme or mkdocs in a js file, may be there is an issue with handling some caching / cookie etc.? Any hint how to debug would be helpfull ☮️ ref: follow-up from: jimporter/mike#243 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This was already answered in jimporter/mike#243 (comment). |
Beta Was this translation helpful? Give feedback.
-
Mike is a wrapper around MkDocs, so it could in theory also modify the bundle.js file of the material theme, and replace the However, it's probably not the right thing to do, as the maintainer of mike would have to make sure that the override of the The I checked out https://mkdocs-material.github.io/example-versioning/latest/ and the cache header time is set to 600 on GitHub Pages. EDIT: The "something else" could be the latest version value, in EDIT2: |
Beta Was this translation helpful? Give feedback.
Mike is a wrapper around MkDocs, so it could in theory also modify the bundle.js file of the material theme, and replace the
versions.json
URL with aversions.json?v=latest-available-version
URL, which would invalidate the cache immediately like you want after a change.However, it's probably not the right thing to do, as the maintainer of mike would have to make sure that the override of the
versions.json
works properly with every mkdocs-material update.The
versions.json
also isn't available during the build process for MkDocs to modify the bundle.js with a hook, because we don't know what the latest version is.However, you could probably make do with a wrapper over mike itself, simila…