Opened 7 years ago
Closed 5 years ago
#28604 closed Cleanup/optimization (fixed)
Prevent ManifestStaticFilesStorage from leaving behind intermediate files
Reported by: | Ed Morley | Owned by: | Nathan Gaberel |
---|---|---|---|
Component: | contrib.staticfiles | Version: | dev |
Severity: | Normal | Keywords: | ManifestStaticFilesStorage, HashedFilesMixin |
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
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:
admin/css/base.css admin/css/base.5af66c1b1797.css admin/css/base.6b517d0d5813.css admin/css/base.31652d31b392.css
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:
https://code.djangoproject.com/ticket/24452#comment:16
https://github.com/django/django/pull/6507
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 (6)
comment:1 by , 7 years ago
Summary: | Adjust HashedFilesMixin so it doesn't leave intermediate files behind for ManifestStaticFilesStorage → Prevent ManifestStaticFilesStorage from leaving behind intermediate files |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
comment:4 by , 6 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:5 by , 6 years ago
Has patch: | set |
---|
comment:6 by , 6 years ago
Needs tests: | set |
---|
comment:7 by , 5 years ago
Needs tests: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
PR