jQuery加载耗时过多 [英] Jquery loading taking excessive time

查看:125
本文介绍了jQuery加载耗时过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用tomcat和MySQL v5.5.24开发一个站点.该网站可以在Chrome上正常运行,但是Firefox和IE会在页面加载20秒钟后始终阻止javascript. Firefox的每个页面(至少来自本地主机)都需要20秒才能加载不同的资源(css/js/image). 问题在于它每次都不都是相同的脚本.可以是任何随机的 虽然在Firefox上,其他站点也能正常工作.附件是来自firefox的时间轴 ![在此处输入图片描述] [2] 使用Chrome加载时,同一页面的加载时间不到1秒.附件是来自Chrome的时间轴.

We are developing a site using tomcat and MySQL v5.5.24. Site works fine on Chrome, however Firefox and IE are blocking javascript consistently for 20 secs on page onload. Every page on firefox from localhost minimum takes 20secs to load for different resources (css/js/image). Problem is that it is not the same script every time. It could be any random Other sites works fine though on firefox. Attached is timeline from firefox ![enter image description here][2] Same page when loaded using Chrome is loading under 1sec. Attached is timeline from Chrome.

推荐答案

我们在web.xml中有此代码,这是导致问题的原因.

We had this code in web.xml which was causing the problems.

<filter>
    <filter-name>2WayFilter</filter-name>
    <filter-class>com.osmoticweb.gzipfilter.GZIP2WayFilter</filter-class>

</filter>

<filter-mapping>

    <filter-name>2WayFilter</filter-name>
    <url-pattern>*.js</url-pattern>

</filter-mapping>

一旦我们将其取出,情况就恢复正常了.

Once we took this out, things were back to normal.

这篇关于jQuery加载耗时过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆