Skip to content

Bust browser caches when JavaScript or CSS changes - #292

Merged
soulgalore merged 1 commit into
mainfrom
content-hash-assets
Oct 21, 2026
Merged

soulgalore merged 1 commit into
mainfrom
content-hash-assets

Conversation

@soulgalore

Copy link
Copy Markdown
Member

JavaScript and CSS are cached for a year, and the cache buster was the server version. A build with changed files but the same version, like a branch under test or a patched install, kept serving the old files to browsers that had them cached. The new HTML then ran against old JavaScript, which can break the page in ways that are hard to understand.

The cache buster is now a hash of the JavaScript and CSS content, calculated when the server starts. Browsers get new files as soon as the content changes, and keep the long cache time when nothing changed. The version shown in the GUI stays the server version.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

JavaScript and CSS are cached for a year, and the cache buster was the server version. A build with changed files but the same version, like a branch under test or a patched install, kept serving the old files to browsers that had them cached. The new HTML then ran against old JavaScript, which can break the page in ways that are hard to understand.

The cache buster is now a hash of the JavaScript and CSS content, calculated when the server starts. Browsers get new files as soon as the content changes, and keep the long cache time when nothing changed. The version shown in the GUI stays the server version.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com
@soulgalore
soulgalore merged commit 933d121 into main Oct 21, 2026
10 checks passed
@soulgalore
soulgalore deleted the content-hash-assets branch October 21, 2026 03:41
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