Opened 16 months ago

Last modified 15 months ago

#28604 new Cleanup/optimization

Prevent ManifestStaticFilesStorage from leaving behind intermediate files

Reported by: Ed Morley Owned by:
Component: contrib.staticfiles Version: master
Severity: Normal Keywords: ManifestStaticFilesStorage, HashedFilesMixin
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently when using ManifestStaticFilesStorage, collectstatic generates duplicate versions of some files.

For example looking at the output for contrib.admin for Django 1.11.5, there is:


This is exacerbated when using something like WhiteNoise's CompressedStaticFilesMixin, which then has to spend extra time generating gzip and Brotli compressed versions of every file (or else try and work around it: evansd/whitenoise#147).

This was called unavoidable/working as intended according to:

However now that it's looking like CachedStaticFilesStorage will end up being removed (mailing list thread; or at the very least we're discouraging people from using it, since it's buggy in several scenarios) - the intermediate files needn't be left behind.

Even before CachedStaticFilesStorage ends up being removed, we could perhaps add a keep_intermediate_files property to HashedFilesMixin, that is set to False for CachedStaticFilesStorage and True for ManifestStaticFilesStorage, allowing us to fix the latter in the meantime.

Change History (3)

comment:1 Changed 16 months ago by Tim Graham

Summary: Adjust HashedFilesMixin so it doesn't leave intermediate files behind for ManifestStaticFilesStoragePrevent ManifestStaticFilesStorage from leaving behind intermediate files
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

comment:2 Changed 15 months ago by Masataka Arai

Owner: changed from nobody to Masataka Arai
Status: newassigned

comment:3 Changed 15 months ago by Masataka Arai

Owner: Masataka Arai deleted
Status: assignednew
Note: See TracTickets for help on using tickets.
Back to Top