By Antithesis Group

Αρχείο για την κατηγορία 'Διάφορα'

On the fly javascript compression/optimization on nginx using Google Closure Compiler

Τρίτη, 03 Μαρτίου 2012

Google closure compiler allows for smaller javascript files that download and run faster. Serving those optimized javascript files instead of the originals and also turning on gzip compression to serve them can save more than 50% on the original size. Using the nginx web server we can automate the compilation of any javascript source files by using Google Closure Compiler without the need to manually run any external tools. Nginx web server will take care of the compilation, keep the compiled version cached and serve this compiled javascript file on future requests.