i trying minify , compress css (and later js) , serve it. end first minify , compress gulp , serve gzipped files django-compressor (so http request made).
i pretty followed guide: http://www.revsys.com/blog/2014/oct/21/ultimate-front-end-development-setup/
using directly gzipped files works good, when try group them django-compressor following error:
uncompressablefileerror @ / unicodedecodeerror while processing '..../static/mincss/filename.min.css.gz' charset utf-8-sig: 'utf8' codec can't decode byte 0x8b in position 1: invalid start byte which corresponds compress tag on:
{% compress css %} <link rel="stylesheet" href="{{ static_url }}mincss/filename.min.css.gz"> ...more files {% endcompress %} i'm 99% sure gzipped generated files correct. us-ascii (subset of utf-8) , contain *.min.css file.
my relevant settings (that know of) issue same ones listed on guide. difference on guide includes css files this:
{% compress css %} <link rel="stylesheet" href="{% static "stylesheets/main.css" %}" /> <link rel="stylesheet" href="{% static "stylesheets/some-other.css" %}" /> {% endcompress %} but way (though works) doesn't use gzipped files, not minified ones. missing?
the included file must not contain gzipped extension. providing file name (*.css) compressor automatically check , load de gzipped version of file (needs have same name plus .gz).
be aware load compressed files on production (with debug=false , offline compression enable)
Comments
Post a Comment