生成网页的合理时间是多少? [英] What's the reasonable time for generating web page?

查看:33
本文介绍了生成网页的合理时间是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发网络应用程序(基于 Rails 3).而且我真的不喜欢生成页面所需的时间 - 根据显示的数据,它需要长达 2.5 秒甚至 4 秒.

I'm working on web app (Rails 3 based). And I really don't like the time it takes to generate the page - depending on the displayed data it takes up to 2.5 and even 4 seconds.

所以我只是想知道在您的应用中生成页面的平均合理时间是多少.假设您检查生成时间,例如它是 750 毫秒,并认为好吧,即使没有缓存也应该没问题".或者当您看到 1.5 秒时,您会想天哪,用户不会等那么久就离开网站"

So I just was wondering what is the average reasonable time for generating page in your apps. Saying you check the generation time, e.g. it's 750ms and think "Ok, that should be fine even without caching". Or when you see 1.5sec you think "Oh my God, the user won't wait so long and leave the site"

推荐答案

关于从查询到渲染的时间以及用户体验的研究数据非常庞大.我建议阅读这篇 useit.com 文章.毕竟谷歌在其结果中整合了页面速度是有原因的 ;)

There's a huge amount of research data regarding the time from query to rendering and user's experience. I'd recommend reading this useit.com article. After all Google integrated page speed in its results for a reason ;)

3 个响应时间限制是今天和我写他们的时候一样1993 年(基于 40 年的研究由人为因素先驱):

The 3 response-time limits are the same today as when I wrote about them in 1993 (based on 40-year-old research by human factors pioneers):

  • 0.1 秒给人一种瞬间反应的感觉——也就是说,结果感觉像是由用户,而不是计算机.这个级别响应能力对于支持直接的感觉操纵(直接操纵是关键的 GUI 技术之一增加用户参与度和控制——有关更多信息,请参阅我们的原则界面设计研讨会).
  • 1 秒可让用户的思维流畅流畅.用户可以感觉到延迟,从而知道计算机是产生结果,但他们仍然感觉在控制整体经验和他们正在移动自由而不是等待电脑.这种程度良好的反应需要导航.
  • 10 秒让用户保持注意力.从 1 到 10 秒,用户绝对感到任其摆布计算机并希望它更快,但是他们可以处理.10秒后,他们开始考虑其他事情,使他们更难获得一旦计算机回到正轨终于有反应了.

10 秒的延迟通常会使用户立即离开网站.和即使他们留下来,也更难了他们了解正在发生的事情,使他们不太可能在任何困难的任务中取得成功.

A 10-second delay will often make users leave a site immediately. And even if they stay, it's harder for them to understand what's going on, making it less likely that they'll succeed in any difficult tasks.

根据经验,您应该始终以优化时间与获得的时间之间的平衡为目标.当您的图像未正确压缩或您的脚本/css 未组合时,不要花费数天时间来优化一个程序.是的,速度越快越好,但通过设置智能缓存生成页面 90% 的收益超过了一周调整算法后 10% 的收益.

As a rule of thumb, think that you always should aim for a balance of optimization time vs time gained. Don't spend days optimizing the hell out of one routine when your images aren't compressed correctly, or your scripts/css not combined. Yes, faster is better, but a 90% gain in generating the page by setting up a smart cache beats a 10% gain after one week tweaking the algorithm.

当框架必须加载所有内容时,也不要过多关注首次渲染时间,而是使用压力测试(无论是否缓存)来模拟各种情况.

Also don't look too much into the first-render-time when the framework has to load everything, but use stress-testing, cached or not, to simulate various situations.

现在,一些数据;我工作过的一些最新站点使用了 DotNetNuke,一个巨大的开源 CMS,和 Asp.Net MVC,在那里你更接近金属.对于 DotNetNuke,平均 db 查询的平均页面时间为 600-700 毫秒.对于 Asp.net MVC,它是 70-100 毫秒...用户真的很喜欢第二个 :)

Now, some data; some of the latest sites i worked on used DotNetNuke, a huge open-source CMS, and Asp.Net MVC where you nearer to the metal. Average page time with average db queries was 600-700 milliseconds for DotNetNuke. For Asp.net MVC, it's 70-100 milliseconds... Users really like the second one :)

这篇关于生成网页的合理时间是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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