Pack and compress all files

Subscribe to Pack and compress all files 10 post(s), 3 voice(s)

 
Avatar Jason 7 post(s)

Is there a way to pack into one compressed file all prototypeJS, scriptaculous and prototype-ui?

 
Avatar StarPeak 22 post(s)

The easy way would be merging the files in this order and using a js packer. You also could load the scripts on the server and put them together and use a packer (like http://code.google.com/p/jsmin-php/ for php)

 
Avatar Sebastien Gr... 7 post(s)

For the one using Ruby on Rails I would recommend asset_packager It merge and minify files in production while keeping them separated for development to provide easy debugging.
Used with GZip it provide a real weight / speed improvement.

 
Avatar StarPeak 22 post(s)

On Rails 2 you could just use the :cache option on stylesheet_link_tag or javascript_include_tag.

See http://api.rubyonrails.org/classes/ActionView/H…

 
Avatar Sebastien Gr... 7 post(s)

Sure that’s great for merging them all together but asset_packager also minify them so brings the weight even lower. if I remember well even if you use gzip after it.

 
Avatar StarPeak 22 post(s)

The :cache option seems to be missing a compressor – that should be fixed in a future release of rails.
Also it cannot compress the css as it looses the relativly linked images. My PHP Framework can handle both issues. Perhaps I should write a rail plugin that does both the same way.

 
Avatar Sebastien Gr... 7 post(s)

Right, would be good to have rails supporting compression for cached files.
If you feel like running for a great patch, that’s the right time as rails 2.1 should come out soon, so patches should be send really soon and pushed to be in ;-)

If you can get the CSS cache issue regarding relative linked image as well that would be simply fantastic.

Hope to see you posting the patch to be included in 2.1 ;-)

 
Avatar StarPeak 22 post(s)

i think it would be more a rails 2.2 push ;) i think until then i would build a plugin

should be a possible task as i have it already got solved in php.

the only problem is that i still got no solution for the cloning problem and neither for the time compression, so i could not say when that would be done :)

 
Avatar Sebastien Gr... 7 post(s)

Did you check asset_packager ? (Link above)

 
Avatar StarPeak 22 post(s)

i used it in a rails 1.2 projekt – but i’m didn’t need a css url rewrite there. So I’m not sure if that would be done by asset_packager. But I think I would use it as base or at least inspiration for an own packager in rails.

One thing i don’t like about asset_packager is the needed rake for creating the packed assets. I more like the way rails 2 does the task transparently.