Skip to content

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

@alvinsiu

Description

@alvinsiu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions