IIS7 the next JS file enable gzip After the solution is not compressed _win server

Source: Internet
Author: User

IIS7 has enabled static file compression (Gzip) but anyway no compression, find after found is II7 MIME type setting problem

Set the MIME type of. js to Application/javascript

View the page again, and gzip is enabled.

However, a few days later found that some of the JS files are compressed, and some did not

Find reason found is referencing JS file is not set type

<script></script>

<script src= "A.js" ></script>

Add type= "Text/javascript" type after the problem is resolved.


How to enable JS compression in IIS7

First turn on IIS management, select the site that I want to set up, and then find MIME types on the right side of the Ribbon to see if there is a. js option, if there is no hand work to add

Some words put the value of. js set to: Application/x-javascript remember not to be less and x some netizens introduction is Application/javascript

I have tried it under the WIN2008+IIS7 and it will not compress without X.

Of course, it is best to upload js before the JS to a compression this effect will be better. Can look for tbcompressor tool on the net, this tool compression is good

Just need your JS write standard, otherwise will be wrong, analysis of your JS grammar can not compress

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.