testing - 服务器响应时间是什么意思

标签 testing optimization

我正在使用 Google 的 Pagespeed Insights 进行网站优化以测试改进。在高优先级修复建议中,是这样的:

Reduce server response time
In our test, your server responded in 2.1 seconds.

我阅读了本节中链接的“有用”文档,现在我真的很困惑。

服务器响应时间是 DNS 响应、第一个字节的时间还是两者的组合?这纯粹是服务器端的问题,还是会受到例如缓慢的 JavaScript 资源或 DOM 中的 ready 事件的影响?

最佳答案

我的第一个猜测是它是从发出请求到从服务器收到第一个字节所用的时间,但谷歌的定义并不完全是这样:

(来自本页https://developers.google.com/speed/docs/insights/Server)

Server response time measures how long it takes to load the necessary HTML to begin rendering the page from your server, subtracting out the network latency between Google and your server. There may be variance from one run to the next, but the differences should not be too large. In fact, highly variable server response time may indicate an underlying performance issue.

花 2.1 秒向我表明您的应用程序/网络服务器正在缓冲它的输出,因此您的所有服务器端处理都在发送内容之前发生。如果您不进行缓冲,则 html 可以开始更快地发送到浏览器,这可能会有所帮助,但是您将无法在逻辑后期执行诸如更改响应 header 之类的操作。

关于testing - 服务器响应时间是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23678080/

相关文章:

mysql - 查询优化器出现奇怪的 mysql 问题

c++ - 使用预先已知的模式进行内存分配

javascript - 如何使用 Protractor 在文件选择器中上传文件?

apache-flex - 哪些选项可用于使用 Perl 测试 flex/flash?

testing - 运行 kdb 脚本的 QA 工具/框架

c - 有哪些重构方法可以减少编译代码的大小?

c# - MS 测试,试图将我的测试名称插入到测试功能中

java - 如何中断 Hibernate session ?

java - 更好的优化

sql - Azure MS SQL 选择需要 10 多分钟