Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cache busting with support for django-sass-processor #43

Open
alvinsiu opened this issue Mar 23, 2023 · 0 comments
Open

Implement cache busting with support for django-sass-processor #43

alvinsiu opened this issue Mar 23, 2023 · 0 comments

Comments

@alvinsiu
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant