渲染时间总是不时地不同

发布于 2024-12-03 23:05:39 字数 227 浏览 7 评论 0原文

我想知道为什么加载某个页面的渲染时间有时会有所不同(我使用了某种浏览器)。我在该页面中有一个java脚本代码..所以当页面加载时,将会出现一个java脚本警报。

我打算将一个浏览器中的页面渲染时间与另一个浏览器中的渲染时间进行比较。但是,当仅在一个浏览器中时,渲染时间可能会有所不同。我如何与另一个浏览器进行比较?只是很难比较这些浏览器的渲染时间。

知道为什么会发生这种情况吗?

非常感谢:)

I wonder why the rendering time to load a certain page is different from time to time (i used one certain browser). I have a java script code in that page..so when the page load, there will be a java script alert coming up.

I'm intending to compare the rendering time of a page in one browser to another. But, when only in one browser the rendering time could be different form time to time..how might i campare to another browser?? It's just hard to compare the rendering time of those browser.

Any idea why this could happen?

Thanks a bunch :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

极致的悲 2024-12-10 23:05:39

您是否在实验室条件下进行测试,即。您确定渲染页面时不会对您的系统资源造成其他负担吗?

最重要的是,您的浏览器、扩展程序、其他选项卡等中是否正在运行任何其他进程。

从何处加载页面也非常重要,如果它不是本地服务器,那么您需要考虑很多变量。

另外,正如 nnnnnn 指出的那样,是加载时间还是渲染时间?

Are you testing under lab conditions, ie. are you sure that there are no other burdens on your system resources when rendering the page.

Most importantly, are there any other processes running in your browser, extensions, other tabs etc. etc.

It's also very important where you're loading the page from, if it's not a local server then you have a lot of variables to consider.

Also, as nnnnnn points out, is it load time, or rendering time?

天气好吗我好吗 2024-12-10 23:05:39

简而言之,以下因素会严重影响渲染时间:

  • 缓存规则
  • 服务器速度和缓存规则服务器加载
  • Cookies
  • 网络(您的互联网连接、服务器的连接速度等)

首先,我会检查缓存规则。根据这些情况,您的浏览器可能会被告知仅在短时间内保存静态元素,从而导致在被告知重新加载这些元素时加载时间更长。

其次,比较一天中不同时间的服务器速度(有可用的在线工具)。
还要看看您的服务器有多“繁忙”。特别是共享服务器有时可能会非常慢。

然后,看看你的代码。如果您设置 cookie,它们可能会影响加载时间,具体取决于它们的大小。 cookie 越大,网站加载速度可能会越慢。

In short, the following factors can heavily influence render time:

  • Caching rules
  • Server speed & server load
  • Cookies
  • Network (your internet connection, the server's connection speed, etc.)

First, I'd check the caching rules. Depending on those, your browser might be told to only save static elements for a short amount of time, resulting in longer loading times when it is told to reload those.

Secondly, compare server speeds at different times of day (there's online tools for this).
Also have a look on how 'busy' your server is. Especially shared servers can be quite slow from time to time.

Then, have a look at your code. If you're setting cookies, these might influence loading time depending on their size. The larger the cookies grow, the slower the site loading might become.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文