Combine your JS and CSS files with pack:tag

Recently I needed to combine a whole heap of javascript files into a few files for performance reasons. On this particular project, we have a very large number of custom widgets we’ve written to extend the awesome YUI library. Keeping our javascript in small, modularized files is great for development and maintenance, and debugging. It does however cause issues when the client has to download close to 100 small < 1kb files. Enter pack:tag, an open source jsp tag library for combining javascript and css written by Daniel Galán y Martins. Its as simple as including a jar, adding the tld and properties files, then using it on your pages.

pack:tag is a JSP-Taglib that minifies, compresses and combines resources (like JavaScript and CSS) and caches them in memory or in a generated file. It works transparent to the user/developer and the compressing-algorithms are pluggable.

So far its worked great, and the reduction in number files, along with filesize by using the built in minify option has been a huge benefit. When I need to debug, its as simple as setting an enable flag to false, and I now have all the individual files at my disposal. If you’re developing in Java-land, and need to combine your js/css files, I strongly recommend checking out this great open source tag library.

pack:tag

  • del.icio.us
  • Digg
and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted April 7, 2008 at 4:54 am | Permalink

    I’m 45 and need to learn about Javascript for elearning, (What it is, what it does). I don’t need to program in it, but I need to know a little more than “it’s a programming language”. Do you know of any resources that are good for my purposes?

  2. brad
    Posted April 7, 2008 at 6:30 am | Permalink

    The best book I’ve come across for Javascript in general is “Javascript: The Definitive Guide”, by David Flanagan. Here’s a link to it: http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanagan/dp/0596101996

  3. Hunter
    Posted January 7, 2009 at 4:23 am | Permalink

    xzsunYKlc8tSP

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Page optimized by WP Minify WordPress Plugin