Shrink JavaScript files with Google Closure Compiler

Bandwidth and browser technology are improving to meet the demands of highly JavaScripted applications, but you still need to be concerned with the size of your JavaScript code.

There are two main reasons why size is important. First, even if the JavaScript you serve is cached, it still needs to be evaluated by the browser on every request. While other loading actions, such as downloading assets, can be run in parallel, JavaScript evaluation can’t. This means that the size of your JavaScript files will have a larger impact on page load time than the size of CSS files or images. Reducing the size of your JavaScript is the only way to reduce the amount of time the browser spends evaluating it.

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of eight full-time members of staff: Editor Georgia Coggan, Deputy Editor Rosie Hilder, Ecommerce Editor Beren Neale, Senior News Editor Daniel Piper, Editor, Digital Art and 3D Ian Dean, Tech Reviews Editor Erlingur Einarsson and Ecommerce Writer Beth Nicholls and Staff Writer Natalie Fear, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq.