Skip to content

Serve assets at content-hashed URLs with one-year cache TTL#288

Merged
JonJagger merged 1 commit intomainfrom
content-hash-assets
Apr 14, 2026
Merged

Serve assets at content-hashed URLs with one-year cache TTL#288
JonJagger merged 1 commit intomainfrom
content-hash-assets

Conversation

@JonJagger
Copy link
Copy Markdown
Member

Computes a SHA256 hash of each asset file at startup and registers routes at the hashed URL (e.g. /assets/app-3f8a2c1b.css). The hash changes on every deploy, busting the browser cache automatically and allowing Cache-Control: public, max-age=31536000. No file copying or Dockerfile changes needed - the hashed URL simply points to the existing file on disk.

Computes a SHA256 hash of each asset file at startup and registers
routes at the hashed URL (e.g. /assets/app-3f8a2c1b.css). The hash
changes on every deploy, busting the browser cache automatically and
allowing Cache-Control: public, max-age=31536000. No file copying or
Dockerfile changes needed - the hashed URL simply points to the
existing file on disk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JonJagger JonJagger merged commit ac2dea2 into main Apr 14, 2026
7 checks passed
@JonJagger JonJagger deleted the content-hash-assets branch April 14, 2026 04:04
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