MVC Series Learning (13)-Merging JS and CSS

Source: Internet
Author: User

1. First to see, without merging JS, the transmission volume is large

1.1 Create a "basic" MVC Project

Then create a new controller HomeController, because JS will be used in many views, so at this point we add a view with Layout page index view. To better see the effect, we remove something that will affect the effect.

Code in 2.2 View, ultra-concise

2.3 Start Test

Run the view, and then monitor the sent requests in HttpWatch

Found, this request index.cshtml view, a total of four requests, and see the data size of each request

"View Compressed Size: 574byte"

"JS Total size: 267676+39920+17056=324652"

2. Start merging JS, the transfer volume is small

2.1 Layout pages, and the code in Bundleconfig are as follows

2.2 View page, as follows

2.3 Start Test

"Size of view page compressed: 592byte"

"JS Pass Size: 52042byte, obviously small"

3. Merge css, merge JS with

MVC Series Learning (13)-Merging JS and CSS

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.