From afa2e28205fe708334ad463b6d3b0e9960b945a6 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Thu, 29 Dec 2022 16:52:56 +0100 Subject: 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. --- docs/ref/contrib/staticfiles.txt | 8 ++++++++ docs/releases/4.2.txt | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'docs') diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt index 0f0e8d8001..7ca3584c33 100644 --- a/docs/ref/contrib/staticfiles.txt +++ b/docs/ref/contrib/staticfiles.txt @@ -336,6 +336,14 @@ argument. For example:: Support for finding paths to JavaScript modules in ``import`` and ``export`` statements was added. +.. attribute:: storage.ManifestStaticFilesStorage.manifest_hash + +.. versionadded:: 4.2 + +This attribute provides a single hash that changes whenever a file in the +manifest changes. This can be useful to communicate to SPAs that the assets on +the server have changed (due to a new deployment). + .. attribute:: storage.ManifestStaticFilesStorage.max_post_process_passes Since static files might reference other static files that need to have their diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index 826545f444..6d2fb32644 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -201,6 +201,10 @@ Minor features replaces paths to JavaScript modules in ``import`` and ``export`` statements with their hashed counterparts. +* The new :attr:`.ManifestStaticFilesStorage.manifest_hash` attribute provides + a hash over all files in the manifest and changes whenever one of the files + changes. + :mod:`django.contrib.syndication` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.3