django-pipeline icon indicating copy to clipboard operation
django-pipeline copied to clipboard

PipelineCachedStorage generated versioned files to late.

Open ceasaro opened this issue 5 years ago • 2 comments

We use javascript files with the tag template {% static 'my_image.jpg' %} (from {% load static %}). The problem with the current PipelineCachedStorage implementation is that this storage first the collects the pipeline bundled files and does later on a super call to collect the other static files.

When it hits the {% static 'my_image.jpg' %}, it looks for a versioned file called my_image.3b1f39551527.jpg, but this files still does not exists. It will only be generated once the call to the super_class.post_process(...) is done.

Is this done deliberated? or can the PipelineCachedStorage be changed to first collect the django static files (super_class.post_process(...)) and afterwards collect the pipeline bundles?

May be related to: https://github.com/jazzband/django-pipeline/issues/638 and https://github.com/jazzband/django-pipeline/issues/462.

ceasaro avatar Feb 28 '19 16:02 ceasaro

I realized now that the pipeline bundles also need a version generated and this can only be done after the bundles are created. Is there a anyway you can generate versioned files for all direct static files and after the pipeline bundles are created only create versioned files for these bundled pipeline files?

ceasaro avatar Mar 01 '19 09:03 ceasaro

Django recommends to use ManifestStaticFilesStorage instead of CachedStaticFilesStorage and in the last Django version, CachedStaticFilesStorage was removed.

Now use PipelineManifestStorage who will use ManifestStaticFilesStorage. It will revolve many problems with file versioning generation.

Pyvonix avatar May 23 '20 10:05 Pyvonix