Web应用程序的建议JS kb限制是多少? [英] What is the recommended JS kb limit for a web app?

查看:178
本文介绍了Web应用程序的建议JS kb限制是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道是否有更多有经验的人可以建议Web应用程序中总JS资源的建议限制。我想确保我没有超载我的带宽。

Just wondering if anyone more experienced out there could suggest a recommended limit for total JS resources in a web app. I want to make sure I'm not overloading my bandwidth.

我目前在两个.js文件之间传播350到400kb(未经过限制)。这不包括jQuery&来自Google CDN的jQuery UI。

I'm currently around 350 - 400kb spread between two .js files (unminified). This is not including jQuery & jQuery UI from Google CDN.

谢谢!

推荐答案

我想每个人都没有真正推荐的文件大小。

I suppose there isn't really a recommended "file size" per-say.

更多建议的整个页面加载时间,包括所有css,图像,javascript ,渲染时间等等太长时间,人们会失去兴趣,但这实际上取决于你的内容,即如果它是人们所追求的非常具体的内容,那么他​​们将等待更长时间,但如果你经营一个电子商务网站,你的竞争对手只需点击一下,然后页面加载时间非常重要。

More a recommended length of time for your entire page to load, including all css, images, javascript, rendering time etc. Too long and people are going to loose interest, but it really depends on your content i.e. if it's very specific content that people are after, then they will wait for longer, but if your running an e-commerce site and your competition is only a click away, then page-load times are very important.

我想答案是让你的文件尽可能小,你的网站加载速度快尽可能。但这将是一个典型的投资回报问题,如果您运营电子商务网站,加载速度更快的网站可以带来更多销售?

I suppose the answer is make your files as small as possible and your site load as fast as possible. But this is going to be a classic return on investment question, if your running an e-commerce site, a faster loading site could lead to more sales?

但要尝试并回答你的问题,400KB对我来说似乎有点沉重。作为一般的经验法则,您希望瞄准 进行10秒以下,以便开始显示页面的2秒加载时间 - 至少给出响应给你的用户。

But to try and answer your question, 400KB seems a little heavy to me. As a general rule of thumb, you want to aim for sub 10 second for a sub 2 second load time of the page beginning to be visible - to at least give a response to your user.

这是Yahoo的加速网站的最佳实践

您还可以运行Y-Slow火炬附加组件或许多其他速度测试来分析并给出建议。

You can also run Y-Slow a firebug add-on, or numerous other speed tests to analyse and give recommendations.

Google的Page Speed网站是一种更加现代的网页速度方式。

Google's Page Speed site is a more contemporary approach to page speed.

这篇关于Web应用程序的建议JS kb限制是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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