Compressing Javascript

2 views
Skip to first unread message

David Zwarg

unread,
Nov 17, 2011, 9:30:26 AM11/17/11
to districtb...@googlegroups.com
Greetings devs,

We are currently using staticfiles to collect all our static files into one common place, but our CSS and javascript is still in many different files. Any strong opinions about using another asset manager?

Please take a second to look over the app comparisons at http://djangopackages.com/grids/g/asset-managers/

I would like to add django-compressor to our apps -- it seems to be well used, has a large developer base, active commits, and includes compression of CSS/JS.

Thoughts?

--
David Zwarg, Software Developer

Azavea  |  One Cambridge Center, 6th Floor, Cambridge, MA 02142-1601
dzw...@azavea.com  | T 617.649.2227  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs

Kenneth Shepard

unread,
Nov 17, 2011, 9:59:34 AM11/17/11
to districtb...@googlegroups.com
I wholeheartedly agree on adding a javascript/css compressor to the app. I've done a little research on this as well, and django-compressor does seem to be one of the most often recommended tools, so it sounds like a safe bet.

Kenny
--
Kenny Shepard

Azavea  |  340 N 12th St, Suite 402, Philadelphia, PA
kshe...@azavea.com  |  T 215.701.7711  |  F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs  |  Twitter @azavea

Andrew Jennings

unread,
Nov 17, 2011, 10:00:33 AM11/17/11
to districtb...@googlegroups.com
Good idea, David.  Looks as if there are a lot of options.  Django-compressor looks to have a lot of great features but it also has a lot of dependencies.  Django-mediagenerator seems to have many of the same features, doesn't have any other dependencies, and has "i8n bundling" as a feature, which may come in handy soon.

- Andrew

On Thu, Nov 17, 2011 at 9:30 AM, David Zwarg <dzw...@azavea.com> wrote:

David Zwarg

unread,
Nov 17, 2011, 10:39:53 AM11/17/11
to districtb...@googlegroups.com
I actually like django-compressor better. Here's why:
  • docs seem more complete
  • fewer changes to settings.py
  • it has an admin command (i.e. pre-deployment compression)
  • there's a development mode that's connected to debug mode
  • the compression specifications are in each template
Looking through the django docs, it looks like the translation strings all get bundled together anyway, in the 'javascript_catalog' view. (https://docs.djangoproject.com/en/dev/topics/i18n/translation/#internationalization-in-javascript-code)

Thoughts?
z

Dr. Micah Altman

unread,
Nov 17, 2011, 11:26:44 AM11/17/11
to districtb...@googlegroups.com
On Thu, Nov 17, 2011 at 10:39 AM, David Zwarg <dzw...@azavea.com> wrote:
I actually like django-compressor better. Here's why:
  • docs seem more complete
  • fewer changes to settings.py
  • it has an admin command (i.e. pre-deployment compression)
  • there's a development mode that's connected to debug mode
  • the compression specifications are in each template
Looking through the django docs, it looks like the translation strings all get bundled together anyway, in the 'javascript_catalog' view. (https://docs.djangoproject.com/en/dev/topics/i18n/translation/#internationalization-in-javascript-code)

ditto.

Also django-compressor seems to have a more active user/dev community.

Here's a comparison I found of various packages:



 

Thoughts?
z


On Thu, Nov 17, 2011 at 10:00 AM, Andrew Jennings <ajen...@azavea.com> wrote:
Good idea, David.  Looks as if there are a lot of options.  Django-compressor looks to have a lot of great features but it also has a lot of dependencies.  Django-mediagenerator seems to have many of the same features, doesn't have any other dependencies, and has "i8n bundling" as a feature, which may come in handy soon.

- Andrew

On Thu, Nov 17, 2011 at 9:30 AM, David Zwarg <dzw...@azavea.com> wrote:
Greetings devs,

We are currently using staticfiles to collect all our static files into one common place, but our CSS and javascript is still in many different files. Any strong opinions about using another asset manager?

Please take a second to look over the app comparisons at http://djangopackages.com/grids/g/asset-managers/

I would like to add django-compressor to our apps -- it seems to be well used, has a large developer base, active commits, and includes compression of CSS/JS.

Thoughts?

--
David Zwarg, Software Developer

Azavea  |  One Cambridge Center, 6th Floor, Cambridge, MA 02142-1601
dzw...@azavea.com  | T 617.649.2227  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs




--
David Zwarg, Software Developer

Azavea  |  One Cambridge Center, 6th Floor, Cambridge, MA 02142-1601
dzw...@azavea.com  | T 617.649.2227  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs



--
________________________________________________________________________
Micah Altman, Ph.D. <http://redistricting.info>           Twitter: @drmaltman   
Senior Research Scientist, Institute for Quantitative Social Science, Harvard U.
Archival Director, Henry A. Murray Archive;
"Entia non sunt multiplicanda sine necessitate" - Dr. Invincibilis (Corollary, "Ad indicia spectate.")


Andrew Jennings

unread,
Nov 17, 2011, 11:42:36 AM11/17/11
to districtb...@googlegroups.com
I'm down with using django-compressor - I didn't notice a big difference in the installation/usage of either package other than the many dependencies for compressor.  That's not a huge deal, just a bullet point.  If compressor is easier to use and more active, let's use it.

- Andrew
Reply all
Reply to author
Forward
0 new messages