简体   繁体   English

IE9慢加载javascript

[英]IE9 slow loading javascript

IE 9 is taking over 10 seconds to display a web page vs Chrome taking less than 3 seconds. IE 9需要花费不到3秒的时间来显示网页与Chrome浏览器的时间超过10秒。

Is there anything we can do to speed up the loading in IE 9? 我们可以做些什么来加快IE 9的加载速度?

35 .js libraries are loaded, with 5 of them taking in total over 11 seconds to load on IE (vs 2 seconds on Chrome). 加载了35个.js库,其中5个库在IE上加载总共超过11秒(在Chrome上为2秒)。 Screenshots below show IE (top) vs Chrome (bottom) longest loading components using websitetest.com. 下面的屏幕截图显示了使用websitetest.com的IE(顶部)与Chrome(底部)最长的加载组件。

It's a customer-facing site, so we have no control of the user browser so can't optimise the client IE at all. 它是一个面向客户的站点,因此我们无法控制用户浏览器,因此根本无法优化客户端IE。 We have all .css files listed first, then .js files, as per recommendations. 我们首先列出所有.css文件,然后按照建议列出.js文件。

加载Internet Explorer v9的最长加载组件的时间

Chrome v45的加载时间为最长的加载组件

A entire response to your question will be far too long. 对您的问题的完整回复将太长。 I can only give some hints : 我只能给出一些提示:

  • Don't provide 35 javascripts files. 不要提供35个javascripts文件。 Provide only one and minify it 只提供一个并缩小它
  • Test and be sure that IE9 use its cache with your static files (javascript, css, images ...) 测试并确保IE9将其缓存与您的静态文件(javascript,css,images ...)一起使用
  • IE9 is very slow with Javascript. 使用Javascript IE9非常慢。 Especially with on thing : modifying the DOM. 特别是on on thing:修改DOM。 Be sure to manipulate your DOM only when you need it. 确保只在需要时操纵DOM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM