js code causes slow to open website

  To achieve a powerful web page, you must use the js file, it is these js files, while enhancing the functionality of the site, also affected the site's opening speed, in general, about js optimization usually have the following three methods.
  Unimportant js at the bottom of the page.
  IIS7 website monitoring
  can get seriously take up the load time of JS or images, css and so the html file
  that is very simple and the effect is well optimized way, unimportant js all placed at the bottom of the page, asynchronous load, that is, and so on pages are loaded over, and then load these unimportant js, so as not to affect the speed of the web page.
  Js file merge
  aim is to reduce the combined js http request, the less request to the server, open faster, but had to combine multiple separate js file requires some skill. Because js is relational, it may be variable declared in front of js code also needs to be called in later js code, if the order is reversed, js call an undefined variable error occurs, so be sure to js merge in order, from top to bottom, and comprising js file js code.
  Js code compression
  is recommended to use compression to complete the online js js code compression.
  Note that affect js code optimization is relatively large, because the search engine to crawl pressure js code, but also affect the speed of the site open, so when optimizing your site, you want to minimize the number and volume of js code can be used to call js forms and functions, in addition, do not add an important link in the js inside.
  When optimizing your site, we found that the site is too slow to open, can be used to check the source file js code, if found too many js code, can be submitted to the technician code adjustments.

Guess you like

Origin blog.51cto.com/14552957/2440307