Home > Web Front-end > JS Tutorial > body text

How to reduce JavaScript file size using Microsoft Ajax Minifier_javascript tips

WBOY
Release: 2016-05-16 18:30:57
Original
935 people have browsed it

When using IIS 7.0 to host your website 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 size. However, you can get additional performance benefits by compressing and minifying your JavaScript files at the same time. Steve Sounders writes in his excellent book
How to reduce JavaScript file size using Microsoft Ajax Minifier_javascript tips

How to reduce JavaScript file size using Microsoft Ajax Minifier_javascript tips
Here is the JavaScript file minified using Microsoft Ajax Minifier (with super squish level enabled):
How to reduce JavaScript file size using Microsoft Ajax Minifier_javascript tips

Note that all unnecessary whitespace has been removed. Also note that the function parameters firstValue and secondValue have been renamed to b and a.

Microsoft Ajax Minifier download contains the following components:

  • ajaxmin.exe – command line tool to minify JavaScript files
  • ajaxmintask.dll – MSBuild task for minifying JavaScript files in Visual Studio projects
  • ajaxmin.dll – A component that can be used to minify JavaScript files in C# or VB.NET applications

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

You can also choose to add Microsoft Ajax Minifier as a custom MSBuild task to Visual Studio. Adding this MSBuild task to your Visual Studio project file allows you to automatically minify all JavaScript files at any time when compiling, allowing you to perform minification operations in an automated manner.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template