Minify your Javascript and CSS

I've just came across scriptalizer.com which is well worth sharing with all.

This site takes your multiple CSS files or Javascript files and compresses them into just one file.

So your CSS goes from:

view plain print about
1<link rel="stylesheet" href="/style/longstylesheet.css" type="text/css" />
2<link rel="stylesheet" href="/style/anotherlongstylesheet.css" type="text/css" />

to:

view plain print about
1<link rel="stylesheet" href="/style/scriptalizer.css" type="text/css" />

Or your Javascript from:

view plain print about
1<script type="text/javascript" src="/js/jquery/jquery.js"></script>
2<script type="text/javascript" src="/js/jquery/jquery.form.js"></script>
3<script type="text/javascript" src="/js/myOwnScriptFile.js"></script>

to this:

view plain print about
1<script type="text/javascript" src="/js/scriptalizer.js" ></script>

Posted: 09-Mar-2009

View: 2687

Permalink: here

Comments

Thanks for the shout-out Andy. Always cool to hear people find your stuff (and think its good) ;)

Aaron Lynch

#1 Aaron Lynch
09/Mar/09 9:48 PM

And.... it's a ColdFusion site written by our community's own Aaron Lynch http://www.aaronlynch.com :)

#2 Dave Shuck
09/Mar/09 9:56 PM

I think it's only important to point out that although it's a very good compression, the files become almost unreadable after it, as all the unnecessary spaces and variable names are changed, so the file has the minimum number of characters as possible. You can still edit it, but its difficult to understand, as the code is a bit different normally.

#3 Marcos Placona
10/Mar/09 4:45 AM

Even Openbluedragon has this now, making use of the Yahoo Compressor, which I think Scriptalizer also uses. Just saw that there was a new CFC on Riaforge, Combine.cfc, which does the same as Scriptalizer, but then serverside. Essentially it does the same as CF_CSS and CF_JS in Openbluedragon. Something for CF 9 maybe?

#4 Sebastiaan
10/Mar/09 4:49 AM

I too would recommend taking a look at http://combine.riaforge.org. It's a really slick way to have your webserver combine and compress multiple JS/CSS files on the fly when the page is requested.

I've been using this library for a little while and really like it. I've made a few enhancements to the library to fix a few bugs and add a few nice enhancements. If you're interested, my updated library is available at http://github.com/RichardDavies/combine.cfc/tree/m.... (I've submitted my code to the original developer, but those changes haven't all been integrated back into the main library yet.)

#5 Richard Davies
10/Mar/09 5:37 PM

Hi Richard. I have updated the project with fixes for the bugs you identified, thanks again for your input. http://combine.riaforge.org/

I'm looking to make some improvements this week. In addition to Richard's suggestions, I also aim to de-couple the JS and CSS compressors (JSmin and YUI css). I want to make it very easy to switch between different compression tools such as JSMin and the YUiCompressors, or to even write your own compression CFC.

#6 Joe Roberts
16/Mar/09 4:13 AM

A few years back, because of the lack of technology, search engines bypass sites that use an Ajax dashboard. Search engines were not programmed to detect java scripts and thus SEO bots do not list them in the search results, instead they only show crawl-able static websites.

Java script
http://ajaxdashboard.com/

#7 Rumana Akter
05/Aug/10 9:27 PM