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

Added a storage which compress only modified packages and invalidates caching automatically #657

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

yguarata
Copy link

@yguarata yguarata commented Mar 14, 2018

This pull request, beyond fix unit test errors, adds four templatetags for prefetching resources and a new storage which I called OptimizedPipelineStorage. This storage adds three new features:

  1. It identifies which packages had removed/added/changed files and will compress only those which have modifications. When you have multiple packages, this will speed up the collectstatic process substantially.

  2. After the compression, this storage produces a single md5 hash from the compressed files. This hash is appended to the resources' URL as a query parameter. Thus, when any package has modifications the compression will produce a new hash and, consequently, the cache's registries for your static files will be automatically invalidated.

  3. It removes from the STATIC_ROOT the source files that were used to produce the compressed files. This is useful when you don't want to expose the raw versions of your javascript and css files.

I found this storage and the new templatetags very valuable for my necessities. I hope it serves to someone else too. Comments are welcome.

user and others added 3 commits March 13, 2018 13:40
@coveralls
Copy link

Coverage Status

Coverage remained the same at 75.0% when pulling 07ccad9 on yguarata:master into 4314d1e on jazzband:master.

@coveralls
Copy link

coveralls commented Mar 14, 2018

Coverage Status

Coverage remained the same at 73.241% when pulling 26e9223 on yguarata:master into 4314d1e on jazzband:master.

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

Successfully merging this pull request may close these issues.

2 participants