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?
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?
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.
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