#24452: Staticfiles backends using HashedFilesMixin don't update CSS files' hash
when referenced media changes
-------------------------------------+-------------------------------------
     Reporter:  Paul McLanahan       |                    Owner:  Paul
                                     |  McLanahan
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  1.7
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

 This is expected, yes. It's required to avoid having
 `CachedStaticFilesStorage` rehash the entirety of static files to ensure
 that the hash is correct, during a cache miss. Without the intermediate
 files it'd have to rehash everything and do multiple passes to ensure it
 is getting the correct file (or weirdness would occur), where as with the
 intermediate files it can simply walk the intermediates for that specific
 file which should only be a couple files. There's more info on the PR, but
 here's a snippet explaining it a bit more:

 > When a cache miss occurs, the original filename is hashed as it
 currently is done today. However, since that may not be the final correct
 hash, the file pointed to by the hashed filename is requested and hashed.
 If the hash matches the name, then the final hash has been reached and
 things continue. If the hash does not match, then the process is repeated,
 requesting the file with the latest hash.

 So it's a required less than ideal situation due to
 `CachedStaticFilesStorage`. That storage should really go the way of the
 dodo due to it's inefficiencies compared to `ManifestStaticFilesStorage`
 which doesn't suffer from that problem since the manifest lists the final
 filename and any intermediates could be dropped.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.3c6df4899eaa64c94bbaa99099341ce6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to