minify - Google Code
minify - Google Code
Ajaxian » Combining JavaScript and CSS for Performance
GWT exceeds at doing this in ways unlike any other toolkit, effectively reducing the number of HTTP requests to load an application down to two, and making all of the application’s code and data effectively cached forever.
It uses a number of mechanisms to do this. It compiles all of the source code and resources at once, aggressively optimizing and obfuscating the Javascript in ways far more compact than JS minifiers/packers. It allows all images to be auto-sprited. It can take sprited images, CSS, locale data, even Flash SWF, and effectively inline them into the same file containing the JS (using data URLs). It includes a CSS optimizer as well, so prior to packing the CSS, it optimizes it.
The end result, is that you can, if you choose, reduce your entire app down to 2 HTTP requests, the second being in the cache 99% of the time, bringing the amortized number of requests to 1. And the data that is cached/loaded, is extremely optimized for size and speed.
The only “downside” for some, is having to use Java. :)
沒有留言:
張貼留言