Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#34235 closed New feature (fixed)

ManifestStaticFilesStorage should expose a "hash" of the manifest file.

Reported by: Florian Apolloner Owned by: Florian Apolloner
Component: contrib.staticfiles Version: dev
Severity: Normal Keywords: htmx unpoly hash asset
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be great if ManifestFilesMixin could expose a manifest_hash that changes whenever *anything* in the manifest itself changes. This would allow SPAs (or applications enhanced with htmx/unpoly etc) to send along a header in responses ala X-Asset-Hash and allow them to perform a full reload if the header changes.

I'll be opening a PR for discussion soon.

Change History (5)

comment:1 by Florian Apolloner, 2 years ago

Has patch: set

comment:2 by Mariusz Felisiak, 2 years ago

Owner: changed from nobody to Florian Apolloner
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 2 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In afa2e28:

Fixed #34235 -- Added ManifestFilesMixin.manifest_hash attribute.

This adds ManifestFilesMixin.manifest_hash attribute exposing a "hash"
of the full manifest. This allows applications to determine when their
static files have changed.

comment:5 by Adam Johnson, 2 years ago

Nice feature, thanks all!

Note: See TracTickets for help on using tickets.
Back to Top