加载后数据是否有助于网页加载性能?
使用 AJAX 加载页面后立即加载不重要的数据是否有助于更快地加载网页?
我的网页上的某些模块不是必需的,因此我使用的基本上是等待基本网页加载,然后使用以下方法加载其余部分:
<script>
$(document).ready(function() {
/* jQuery $.post statement to load data into specific divs */
});
</script>
这会有助于加载性能还是实际上会阻碍加载性能?如果我没记错的话,Facebook 做了类似的事情,但我不太确定如何做(但我确信他们的系统更加复杂和令人印象深刻)
Does loading unimportant data right after page load using AJAX help load the web page faster?
Certain modules on my web page are not essential so what I'm using is basically waiting for the basic web page to load and then loading the rest using:
<script>
$(document).ready(function() {
/* jQuery $.post statement to load data into specific divs */
});
</script>
Would this help loading performance or actually hinder it? If I remember correctly, Facebook does something like this, but I'm not exactly sure how (but I'm sure their system is much more elaborate and impressive)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只有在以下情况下才会真正有帮助:
a) 你的页面非常非常大,有很多图像等。
b) 由于其他依赖关系,你的代码要么效率低下,要么速度慢。
b) 如果后期加载最终对整体用户体验做出了贡献。
在最后一点上,用户体验可能是加载时间,或者当他们选择某些内容时,在请求时以平稳、快速和无缝的方式加载数据。
无论如何,这就是我的 2 美分价值
it would only really help if;
a) your page was very, very large with a lot of images etc.
b) your code behind was either inefficient or slow due to other dependancies
b) if the post loading ultimately contributed to the overall UX.
On that last point, user experiance may be load time or when they select something that the data is loaded when requested in a smooth, quick and seamless manner.
that's my 2 cents worth anyway
我刚刚在以下问题中回答了一个非常类似的问题
希望它能帮助您澄清一些问题。
I just answered a very similar question in the following SO question
Hopefully it will help you clarify some of your questions.