﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24452	Staticfiles backends using HashedFilesMixin don't update CSS files' hash when referenced media changes	Paul McLanahan	Paul McLanahan	"Steps to reproduce when using the Cached or Manifest staticfiles storages:

1. Have an image ({{{a.jpg}}}) and a CSS file that references this image in a {{{url()}}} call.
2. Run {{{collectstatic}}} and observe that copies of said files now have hashed names.
3. Change the content of {{{a.jpg}}} (the color was clearly wrong).
4. Run {{{collectstatic}}} again
5. Observe that {{{a.jpg}}} now has a new hashed name version
6. Obesrve that the CSS file refers to this new version, but the hashed name of the CSS file has '''not''' changed. 

Because the CSS file's hash name was determined before processing the file's contents, changes in the referenced assets (images, fonts, etc.) will not result in a new hashed CSS file name. Thus when using a CDN and very long cache expire headers the CSS will never update, and the new version of the image will never be seen on the site. 

We're currently working around this by making insignificant changes to the CSS whenever we need to make changes to only the content of referenced media, but this is error prone and clearly suboptimal.

This was observed in 1.6 using the {{{CachedStaticFilesStorage}}}, but I testing in 1.7 as well. A fix could be backported to the 1.6 line should it come before 1.6 is unsupported and a patch release is desired.

Note: This was discovered in [https://github.com/mozilla/bedrock/ mozilla/bedrock] (www.mozilla.org). More information may be added to [https://bugzilla.mozilla.org/show_bug.cgi?id=1139606 the Mozilla bug about this] as well."	Bug	closed	contrib.staticfiles	1.7	Normal	fixed		David Sanders Ed Morley	Ready for checkin	1	0	0	0	0	0
