Ways to reduce JavaScript file size using Microsoft Ajax minifier _javascript Tips

Source: Internet
Author: User
When you use IIS 7.0来 to host your site on a Windows server, you can configure IIS to automatically compress your JavaScript files using the gzip compression algorithm, which provides significant improvements in performance and file download sizes. However, you can get additional performance benefits by compressing and narrowing (minifying) your JavaScript files at the same time. Steve Sounders in his excellent books



The following is a reduced JavaScript file with Microsoft Ajax Minifier (Super Flattening level enabled):

Note that all unnecessary whitespace is removed, and note that the parameter firstvalue and secondvalue of the function are renamed B and a.

The Microsoft Ajax minifier Download contains the following components:

    • ajaxmin.exe– command line tools to shrink JavaScript files
    • ajaxmintask.dll– the MSBuild task of a JavaScript file in a Visual Studio project
    • ajaxmin.dll– components that can be used to shrink JavaScript files in C # or vb.net applications

After installing Microsoft Ajax Minifier, you can use the Microsoft Ajax Minifier command-line tool to shrink JavaScript files on the console command line.

You can also choose to add Microsoft Ajax Minifier as a custom MSBuild task to Visual Studio. Add the MSBuild task to your Visual Studio project file, allowing you to automatically shrink all JavaScript files at any time, allowing you to zoom out in an automated manner.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.