fix: Derive backoffice bundle cache-bust ?v= from version.json#307
Merged
Conversation
The entry point's `?v=` query in umbraco-package.json was frozen at a stale value (5.4.0 on v5, 6.0.0-rc1 on v6) because the vite cacheBustImports plugin read the version from public/umbraco-package.json (a static field) and only appended ?v= when absent, while the UpdatePackageManifestVersion MSBuild target fixed `version` but never the `?v=`. As a result the entry bundle URL never changed across releases, so browsers that had cached index.js?v=5.4.0 kept serving the old frontend after upgrading — the merged fixes never reached them. Read the cache-bust token from version.json (the per-release source of truth, bumped every release) and always (re)write ?v= to it; also keep the manifest's version field in sync. Now each release produces a unique ?v= and busts the cache. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
The published
umbraco-package.jsonfroze the entry point's cache-bust query at a stale value —index.js?v=5.4.0(and?v=6.0.0-rc1on v6) — across every release, including 5.4.2/6.0.1.Root cause: the vite
cacheBustImportsplugin read the version frompublic/umbraco-package.json(a static field that was last set to 5.4.0) and only appended?v=when it was absent; theUpdatePackageManifestVersionMSBuild target updatesversionbut never the?v=. So the entry bundle URL never changed between versions, and browsers that had cachedindex.js?v=5.4.0from 5.4.0/5.4.1 kept serving the old frontend after upgrading — the merged fixes never reached them.Fix
Source the cache-bust token from
version.json(the per-release source of truth, bumped on every release) and always (re)write?v=to it; also keep the manifest'sversionfield in sync. Each release now produces a unique?v=.Verified
npm run buildon this branch (version.json = 5.5.0-alpha) produces:🤖 Generated with Claude Code