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.