Skip to content

Add cache-busting fingerprints to JS assets - #3

Merged
SeiferTim merged 1 commit into
mainfrom
copilot/deploy-gh-pages
Aug 7, 2026
Merged

Add cache-busting fingerprints to JS assets#3
SeiferTim merged 1 commit into
mainfrom
copilot/deploy-gh-pages

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

JS assets (InfiniteEngine.js, script.js, bootstrap.bundle.min.js) were served without content hashes, causing browsers to serve stale cached versions after deploys — most visibly the Haxe/Lime engine component.

Changes

  • layouts/partials/head/infinite-engine.html — pipe InfiniteEngine.js through Hugo's fingerprint, add integrity attribute
  • layouts/partials/scripts.html — pipe script.js through fingerprint after minify, add integrity attribute
  • layouts/partials/head/bootstrap.html — pipe bootstrap.bundle.min.js through fingerprint, add integrity attribute

CSS was already fingerprinted; this brings JS assets to parity. Each deploy now produces uniquely-named JS URLs, forcing browsers to fetch the latest build.

<!-- before -->
{{ $engine := resources.Get "js/InfiniteEngine.js" }}
<script src="{{ $engine.RelPermalink }}"></script>

<!-- after -->
{{ $engine := resources.Get "js/InfiniteEngine.js" | fingerprint }}
<script src="{{ $engine.RelPermalink }}" integrity="{{ $engine.Data.Integrity }}" crossorigin="anonymous"></script>

Co-authored-by: SeiferTim <141478+SeiferTim@users.noreply.github.com>
@SeiferTim
SeiferTim marked this pull request as ready for review August 7, 2026 03:37
Copilot AI lite review requested due to automatic review settings August 7, 2026 03:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Hugo Pipes fingerprinting (content-hash cache busting) and Subresource Integrity (SRI) attributes to first-party JavaScript assets so browsers reliably fetch updated JS after deploys, aligning JS behavior with the already-fingerprinted CSS pipeline.

Changes:

  • Fingerprint InfiniteEngine.js and add integrity + crossorigin on its <script> tag.
  • Minify then fingerprint script.js, adding integrity + crossorigin.
  • Fingerprint bootstrap.bundle.min.js in production and add integrity (keeping the existing production crossorigin).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
site/layouts/partials/scripts.html Adds fingerprint after minify for script.js and emits SRI attributes.
site/layouts/partials/head/infinite-engine.html Fingerprints InfiniteEngine.js and adds SRI attributes to prevent stale engine JS caching.
site/layouts/partials/head/bootstrap.html Fingerprints production Bootstrap bundle and adds SRI integrity for the generated asset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SeiferTim
SeiferTim merged commit 60753d4 into main Aug 7, 2026
2 checks passed
@SeiferTim
SeiferTim deleted the copilot/deploy-gh-pages branch August 7, 2026 03: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.

3 participants