Skip to content

rx.asset: add content-hash cache-busting to returned URL #6550

@sorousch9

Description

@sorousch9

Currently rx.asset() returns a plain path like /my-image.png. When you redeploy with an updated asset, browsers may serve the stale cached version since the URL hasn't changed.

The fix is straightforward: append a short SHA-256 hash of the file's contents as a query parameter (?v=<8-char-hash>), so the URL only changes when the file actually changes. This gives permanent cacheability without manual cache invalidation.

current

rx.asset("logo.svg") # → /logo.svg

proposed

rx.asset("logo.svg") # → /logo.svg?v=a1b2c3d4
We've been running this in production with a local wrapper and it works well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAnything you want improved

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions