1

When a JavaScript file is sent over an HTTP connection, the entire file is sent, and then the preprocessor on the clientside will deal with the rest?

Therefore, would removing comments and whitespace in a .js file optimize a js file for transfer?

1

3 Answers 3

1

I use Google Closure, gzip, and header cache tags to optimize my js transfer.

2

If you are working on a large project you can modularize your javscript code and load asynchronously using requirejs. This way you don't have to load the complete library code.

1

You may use Closure Compiler which is a minimization tool used to compress JS code even further than existing minimization tools.

For further details, you may visit http://www.techstrikers.com/Javascript/javascript-tutorials.php

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .