views:

334

answers:

5

I have a rails appln which uses ext-js for front end. I have no problem in running the application.

But since ext-all.js is bulky, it takes more time to load. I tried to build a custom ext-js but did not make much of a difference in size of the ext js script.

I was trying with rails cache since i use rails 2.x. For normal js files, it has no problem in caching but for ext-js scripts, it loads but some DOM object errors come. Say for e.g. Ext is not defined.

What i am looking for is compressed version of ext js scripts or with gzip mode. I tried googling and various options to try compression. But yet to crack it.

Could you please provide me some pointers on how to solve the compression problem.

Thanks, -Rajesh [email protected]

A: 

Try JS Minifier.

Chris Doggett
A: 

Various Ext-specific options for custom builds explained here:

http://extjs.com/learn/Tutorial:Building_Ext_From_Source

For compression there are many options. YUICompressor is one of the best right now. Not sure what you mean by "gzip mode." Gzip is an option that should be enabled at the web server level and has nothing to do with Ext or JavaScript.

bmoeskau
A: 

Ext is already minified in the production files so to minify further is futile you should only minify your own scripts.

You could look into CacheFly which may provide Ext to your customers faster given it's distributed nature.

The only other option is indeed to do HTTP request level compression using mod_gzip in Apache or the like.

Lloyd
A: 

ExtJs size is not much bigger (if any) than most of modern web-sites. It's something below 1MB together with your scripts. And it's loading only one time. I think, with the current network speeds it has nearly of no impact for clients.

Thevs