Skip to content

build: enable sbt-digest for content-addressed asset URLs#101

Merged
deepanshutr merged 1 commit into
explorer/masterfrom
explorer/sbt-digest-pipeline
Apr 29, 2026
Merged

build: enable sbt-digest for content-addressed asset URLs#101
deepanshutr merged 1 commit into
explorer/masterfrom
explorer/sbt-digest-pipeline

Conversation

@deepanshutr
Copy link
Copy Markdown
Contributor

Summary

  • Adds the standard Play web-asset pipeline plugin (sbt-digest) and enables it during dist/stage.
  • After this lands, @routes.Assets.versioned(\"...\") (already used by 24 templates) emits content-addressed URLs at build time:
    • before: /assets/javascripts/chart/lineChart.js (cache max-age=3600)
    • after: /assets/javascripts/chart/ad1c28c9e1743c53446832c659baab1f-lineChart.js (cache max-age=31536000, immutable)
  • Browser caches now auto-invalidate on every deploy that touches an asset, with no manual ?version= bumps and no custom helper.

Test plan

  • Built ghcr.io/assetmantle/client:digest-pipeline (sha256:a2deab2d178e48ce1992076a06ead9fa3b9b4240c5eaac4efe060f18dd353d9a); the assets jar contains *.md5 digest manifest entries.
  • Live deploy on Akash DSEQ 26587209 (tx C57E2B21…).
  • Homepage <script> tags now reference fingerprinted paths like /assets/javascripts/90cf30a35cd4eea1643aaa478440fbe0-theme.js.
  • Fingerprinted URL responds with cache-control: public, max-age=31536000, immutable.
  • https://explorer.assetmantle.one/component/tokensPrices returns 200.

🤖 Generated with Claude Code

@routes.Assets.versioned("...") now emits /assets/<md5>-<file> at build
time, so deploys auto-invalidate browser caches. Combined with Play's
default cache-control on fingerprinted assets (max-age=31536000,
immutable) end-users never see stale JS/CSS again.

No template changes - the 24 templates already use routes.Assets.versioned;
they just start producing fingerprinted URLs once the pipeline runs.
@deepanshutr deepanshutr merged commit 3c7c99b into explorer/master Apr 29, 2026
@deepanshutr deepanshutr deleted the explorer/sbt-digest-pipeline branch April 29, 2026 07:08
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