为了提高网站加载速度,我们的目标应该是什么:减少 http 请求/节省整体页面大小?
(我的网站有 110Kb 的图像、1 个旋转器、2 种 google 字体)
我的 WordPress 网站发出了 30 个 http 请求,加载时间为 7 秒,总页面大小 220Kb。通过更改各种插件,我设法将请求减少到 22、6.1 秒,页面大小膨胀到 320Kb(2 个 google 字体,由 websiteoptimise.com 分类为 CSS 图像)
。毫无疑问,结合 .js 可以减少文件大小,但它会阻碍一切。
我尝试了各种脚本压缩器,但结果相似。仍然是Yslow & PageSpeed 对缩小文件大喊大叫(这个文件本来可以压缩 40%...)
我的问题是我们应该瞄准什么?减少http请求/缩小&合并文件/防止整体页面大小膨胀?
(My site has 110Kb in images, one rotator, 2 google fonts)
My Wordpress site made 30 http requests, took 7 seconds to load, overall page size 220Kb. By changing various plugins, I managed to bring down the requests to 22, 6.1 seconds, page size bloated to 320Kb (2 google fonts classified as CSS images, by websiteoptimisation.com)
Because minifying & combining .js no doubt, reduces filesize, but then it sits in the middle blocking everything.
I tried various script compressors, but with similar results. Still Yslow & PageSpeed shout on minified files (this file could have been compressed by 40%...)
My question is what should we aim at? reduce http requests/minify & combine files/prevent bloating overall page size?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原则上,这取决于许多因素(例如,如果您的用户带宽较低,最好将页面大小保持在最小值。)
然而,在我看来,一般来说,http 请求的数量比页面大小重要得多。
请记住,现代浏览器可以缓存静态内容(.js 文件、.css 等),因此页面大小可能会随着时间的推移而减小。
如果您可以提供有关您的页面生成的请求的更多信息,也许我们可以为您提供更具体的建议。
In principal, it depends on many factors (such as- if your users have low bandwidth, it might be preferable to keep the page size to a minimum.)
In my opinion, however, generally- the number of http requests is far more important than page size.
keep in mind that modern browsers can cache static content (.js files, .css etc.), so the page size might reduce over time.
If you can supply some more info on the requests your page generates, perhaps we can give you more specific advice.