Repository navigation
fix(site): version stylesheet and script URLs so deploys reach returning visitors - #69
Merged
Merged
Conversation
…ing visitors The server lets browsers keep CSS and JS files for 4 hours (cache-control: max-age=14400), and the site's own files keep the same name from one deploy to the next. After a deploy a returning visitor gets the new HTML with the old script or stylesheet. This is why the History section of the specification pages stayed on its fallback text after #68 was deployed: the cached specifications.js predated it. A new hook, hooks/asset_versions.py, links every local entry of extra_css and extra_javascript as <path>?v=<first 10 hex digits of the file's SHA-256>. The suffix only changes when the file does, so browsers keep their copy between deploys and fetch the new one as soon as it changes. External URLs are left alone, and Material's own bundle already has a hash in its name. Nothing changes for visitors: the same file is served with or without the suffix. Checked with ProperDocs 1.6.7: every page links e.g. assets/javascript/specifications.js?v=4f9819e1de, and the GBFS page still loads its History section and js-yaml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
carlfredl
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #68 was deployed, the History section on the specification pages showed only its fallback text ("Changes to this entry are reviewed on GitHub...") for anyone who had visited the site before.
Cause: the server lets browsers keep CSS and JS files for 4 hours (
cache-control: max-age=14400), and the site's own files keep the same name from one deploy to the next. A returning visitor got the new HTML but reused the oldspecifications.js, which predates the History section. A browser with an empty cache showed the section correctly. Every future change to a stylesheet or script would hit the same problem.Fix
A new hook,
hooks/asset_versions.py, links each local entry ofextra_cssandextra_javascriptwith a version taken from the file's content:Testing
Note
.claude/launch.jsonstill points toconfig/en/mkdocs.yml, which was renamed toproperdocs.ymlin 267a022, so the local preview entries no longer start. Not changed here.🤖 Generated with Claude Code