A standard way to implement cache busting is to use ManifestStaticFilesStorage. However, this breaks build steps when used in conjunction with django-sass-processor.
Here are some relevant links:
Context:
Say we have a local font file we want to reference in our sass file. If we hard-code the value, cache busting does not get applied since it's hard-coded. If we use the django-static python function (that we've configured in settings.py for django-sass-processor), cache busting does get added, but there's a problem build order:
If you run python manage.py compilescss before running python manage.py collectstatic, the sass compilation fails since no manifest file is found (generated by collectstatic).
If you run collectstatic first, then the compiled scss files are not moved to staticfiles.
If you run collectstatic before compilescss and then collectstatic again, the cache busting hash is added to django-static twice (once by compilescss and once by collectstatic).
A standard way to implement cache busting is to use
ManifestStaticFilesStorage. However, this breaks build steps when used in conjunction withdjango-sass-processor.Here are some relevant links:
Context:
Say we have a local font file we want to reference in our sass file. If we hard-code the value, cache busting does not get applied since it's hard-coded. If we use the
django-staticpython function (that we've configured insettings.pyfordjango-sass-processor), cache busting does get added, but there's a problem build order:If you run
python manage.py compilescssbefore runningpython manage.py collectstatic, the sass compilation fails since no manifest file is found (generated bycollectstatic).If you run
collectstaticfirst, then the compiled scss files are not moved tostaticfiles.If you run
collectstaticbeforecompilescssand thencollectstaticagain, the cache busting hash is added todjango-statictwice (once bycompilescssand once bycollectstatic).