asp.net MVC uses scripting optimizations to increase page load speed:

Source: Internet
Author: User
Tags http request script tag

Here we say three ways to script optimization:

First, when we do web development, when we refer to the JS file, we will generally put the JS file in the head tag of the document, when the page load, the browser will press the order from top to bottom, when the browser encountered a script tag, it will prevent other content download, Knowing that he has retrieved the entire script will slow down the page load, so the script tag should be positioned as far as possible at the bottom of the page (just before the body ends the tag) to produce a good user experience.

Another technique for reducing page load time is to streamline custom scripts. For example, we often use the jquery.validate.min.js and Jquery.validate.js, the former is a streamlined script.

Third, reduce the number of script tags sent to clients. For any page, the browser sees the optimal number of script tags as one. To achieve this optimal number, we can use a script Consolidator to bundle multiple JS files into a single resource file. Now there are a lot of script consolidator to use, some of which are built to create files in a project, and other jobs that dynamically merge scripts to the corresponding HTTP request at run time, and for the latter, a Consolidator is recommended here: http://combres.codeplex.com/.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/

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.