I am having javascript file of arround size 400kb which is very alligned and well formatted. But I have seen there is lot of difference in file size if it is one line(most of javascripts).
So I was thinking to reduce it's memory size so it will load somewhat faster. Please suggest me any tools or method for removing white spaces from that file?
Try http://jscompress.com/ online tool.
What Is jscompress?
JSCompress.com is an online javascript compressor that allows you to compress and minify your javascript files. Compressed javascript files are ideal for production environments since they typically reduce the size of the file by 30-90%. Most of the filesize reduction is achieved by removing comments and extra whitespace characters that are not needed by web browsers or visitors.
Why Would I Want To Compress Javascript?
There are a number of reasons why compressing your javascript files is a good idea:
* Quicker download times for your users.
* Reduced bandwidth consumption of your website.
* Reduced number of HTTP requests on your server when combining many javascript files into one compressed file, thus reducing the server load and allowing more visitors to access your website.
* Comments and whitespace are not needed for javascript execution; Removing them will speed up script execution times.