django-compressor

Compresses linked and inline javascript or CSS into a single cached file.

Popularity
6.9
Declining
Activity
6.9
Growing
2,872
44
609

Description

Django Compressor combines and compresses linked and inline Javascript or CSS in a Django template into cacheable static files by using the compress template tag.

HTML in between {% compress js/css %} and {% endcompress %} is parsed and searched for CSS or JS. These styles and scripts are subsequently processed with optional, configurable compilers and filters.

The default filter for CSS rewrites paths to static files to be absolute and adds a cache busting timestamp. For Javascript the default filter compresses it using jsmin.

As the final result the template tag outputs a or <link> tag pointing to the optimized file. These files are stored inside a folder and given a unique name based on their content. Alternatively it can also return the resulting content to the original template directly.<br><br>Since the file name is dependent on the content these files can be given a far future expiration date without worrying about stale browser caches.<br><br>The concatenation and compressing process can also be jump started outside of the request/response cycle by using the Django management command manage.py compress.

Code Quality Rank: L3
Programming language: Python
License: MIT License
Latest version: v2.4

django-compressor alternatives and similar packages

Based on the "Asset Management" category.
Alternatively, view django-compressor alternatives based on common mentions on social networks and blogs.

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of django-compressor or a related project?

Add another 'Asset Management' Package

Do not miss the trending, packages, news and articles with our weekly report.

Awesome Python is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
We recommend Spin The Wheel Of Names for a cryptographically secure random name picker.

AltStyle によって変換されたページ (->オリジナル) /