[Django] #28604: Adjust HashedFilesMixin so it doesn't leave intermediate files behind for ManifestStaticFilesStorage

13 views
Skip to first unread message

Django

unread,
Sep 16, 2017, 7:23:20 PM9/16/17
to django-...@googlegroups.com
#28604: Adjust HashedFilesMixin so it doesn't leave intermediate files behind for
ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: Ed Morley | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
contrib.staticfiles | Keywords:
Severity: Normal | ManifestStaticFilesStorage,
Triage Stage: | HashedFilesMixin
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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: [https://github.com/evansd/whitenoise/issues/147
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 ([https://groups.google.com/forum/#!topic/django-
developers/fmfQvuHBStk 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28604>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 25, 2017, 12:27:01 PM9/25/17
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files

-------------------------------------+-------------------------------------
Reporter: Ed Morley | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ManifestStaticFilesStorage, |
HashedFilesMixin |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:1>

Django

unread,
Oct 24, 2017, 5:12:37 AM10/24/17
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------
Reporter: Ed Morley | Owner: Masataka
Type: | Arai
Cleanup/optimization | Status: assigned

Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ManifestStaticFilesStorage, |
HashedFilesMixin |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Masataka Arai):

* owner: nobody => Masataka Arai
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:2>

Django

unread,
Oct 29, 2017, 12:08:31 AM10/29/17
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------
Reporter: Ed Morley | Owner: (none)
Type: | Status: new
Cleanup/optimization |

Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ManifestStaticFilesStorage, |
HashedFilesMixin |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Masataka Arai):

* status: assigned => new
* owner: Masataka Arai => (none)


--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:3>

Django

unread,
Apr 13, 2019, 5:39:25 AM4/13/19
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------
Reporter: Ed Morley | Owner: Nathan
Type: | Gaberel
Cleanup/optimization | Status: assigned

Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ManifestStaticFilesStorage, |
HashedFilesMixin |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nathan Gaberel):

* owner: (none) => Nathan Gaberel


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:4>

Django

unread,
Apr 13, 2019, 9:17:55 AM4/13/19
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------

Reporter: Ed Morley | Owner: Nathan
Type: | Gaberel
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ManifestStaticFilesStorage, |
HashedFilesMixin |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nathan Gaberel):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/11216 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:5>

Django

unread,
May 22, 2019, 1:06:32 AM5/22/19
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------

Reporter: Ed Morley | Owner: Nathan
Type: | Gaberel
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ManifestStaticFilesStorage, |
HashedFilesMixin |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:6>

Django

unread,
Jun 3, 2019, 7:51:36 AM6/3/19
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------

Reporter: Ed Morley | Owner: Nathan
Type: | Gaberel
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
ManifestStaticFilesStorage, | checkin
HashedFilesMixin |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:7>

Django

unread,
Jun 3, 2019, 7:55:52 AM6/3/19
to django-...@googlegroups.com
#28604: Prevent ManifestStaticFilesStorage from leaving behind intermediate files
-------------------------------------+-------------------------------------

Reporter: Ed Morley | Owner: Nathan
Type: | Gaberel
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
ManifestStaticFilesStorage, | checkin
HashedFilesMixin |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b27c9c953bce3aed205ebc378350ef027ebdd25b" b27c9c95]:
{{{
#!CommitTicketReference repository=""
revision="b27c9c953bce3aed205ebc378350ef027ebdd25b"
Fixed #28604 -- Prevented ManifestStaticFilesStorage from leaving
intermediate files.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28604#comment:8>

Reply all
Reply to author
Forward
0 new messages