[Frontend optimization] use Microsoft Ajax minifier to compress and optimize resource files

Source: Internet
Author: User

In front-end optimization, JS, CSS and other file optimization are generally compression optimization, merging, and reducing the volume to reduce the request.

Today, we found a compression plug-in integrated in vs to make compression faster.

Configuration method

First, you need to download microsoft Ajax minifier and install it all the way. If vs is in use, restart it.

Right-click your web project and click "Uninstall" to make it gray.

Click Edit on the uninstalled project and add the configuration node to the proj file, as shown below:

Configure nodes. Refer to the section in this blog post:

The include attribute is the directory path to be compressed and contains file wildcards.

Exclude indicates the file path without compression.

Webresources is the folder under my root directory, which can be adjusted according to the actual project

The ajaxmin node has some parameter settings for compression. For details, refer to the following connections for more settings.

Compile the project, and the renamed and compressed resource file appears in the corresponding folder, which can be directly used during release.

Note:

When we meet our webProgramNoWebapplicationInstead, you need to install Web deployment in the website format. This is for vs2010, and other versions can be found at the bottom of the page.

After installation, perform the preceding operations on the added web_deploy project.

The generated resource file is in the folder corresponding to web_deploy \ debug.

Compression Effect

The compression ratio is very obvious. It is recommended.

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.