Skip to content

fix: Derive backoffice bundle cache-bust ?v= from version.json#307

Merged
rickbutterfield merged 1 commit into
v5/devfrom
v5/bugfix/manifest-cache-bust-version
Jun 30, 2026
Merged

fix: Derive backoffice bundle cache-bust ?v= from version.json#307
rickbutterfield merged 1 commit into
v5/devfrom
v5/bugfix/manifest-cache-bust-version

Conversation

@rickbutterfield

Copy link
Copy Markdown
Owner

Problem

The published umbraco-package.json froze the entry point's cache-bust query at a stale value — index.js?v=5.4.0 (and ?v=6.0.0-rc1 on v6) — across every release, including 5.4.2/6.0.1.

Root cause: the vite cacheBustImports plugin read the version from public/umbraco-package.json (a static field that was last set to 5.4.0) and only appended ?v= when it was absent; the UpdatePackageManifestVersion MSBuild target updates version but never the ?v=. So the entry bundle URL never changed between versions, and browsers that had cached index.js?v=5.4.0 from 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's version field in sync. Each release now produces a unique ?v=.

Verified

npm run build on this branch (version.json = 5.5.0-alpha) produces:

"version": "5.5.0-alpha",
"js": "/App_Plugins/Umbraco.Community.BlockPreview/index.js?v=5.5.0-alpha"

Note: 5.4.2 is already published with the stale ?v=. A follow-up patch (5.4.3 / 6.0.2) built with this fix is needed to actually bust the cache for existing installs.

🤖 Generated with Claude Code

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>
@rickbutterfield rickbutterfield merged commit eaa275c into v5/dev Jun 30, 2026
4 checks passed
@rickbutterfield rickbutterfield deleted the v5/bugfix/manifest-cache-bust-version branch June 30, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant