网页的大小是否有最大限制?
当我说大小时,我指的是字节而不是像素。
我很好奇对于不同类别的最大尺寸是否有任何共识。具体来说:
- 宽带连接
- 拨号连接
- 移动连接
When I say size I'm talking about bytes not pixels.
I'm curious if there is any consensus on what the maximum size should be for various categories. Specifically:
- Broadband connections
- Dialup connections
- Mobile connections
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尺寸并不代表一切。重要的是性能。更好的是:感知的表现。有很多方法可以让网站感觉比实际速度更快。其中一些技术甚至可以增加您的绝对页面大小(以字节为单位)(例如,向其中添加更多 JavaScript 逻辑)。
使用 Yahoo! 等工具测试您的网站YSlow 并停止关注页面大小。这只是网站性能的因素之一,甚至不是最重要的因素。
Size isn't everything. What matters is performance. Better even: perceived performance. There are many ways to make a website feel faster than it really is. Some of these techniques can even increase your absolute page size in bytes (e.g. adding more javascript logic to it).
Test your websites with a tool like Yahoo! YSlow and stop focussing on page size. That's just one factor of website performance and not even the most important one.
根据您希望页面加载时间尽可能短的连接情况。
最佳时间小于 4 秒。
“领先的网络流量控制者 Akamai Technologies 进行的一项研究表明,设计不当的网站会在几秒钟内失去 30% 的客户。
同一项研究还发现,如果一个网站的加载时间超过四秒,75% 的观众就不会再返回该网站。”
http://www.ianbrodie.com/get-clients-online /lose-website-visitors-in-5-分钟/
比大小更重要的是遵循一些简单的规则和最佳实践。
升级网站的最佳实践
http://developer.yahoo.com/performance/rules.html
所以粗略的估计是
Depending on the connection you want the page loading in as less time as possible.
Less than 4 seconds is optimal.
"A study conducted by leading web traffic controller Akamai Technologies revealed that a poorly designed website loses a full 30 percent of its customers within a few seconds.
The same study also found that if a site takes longer than four seconds to load, 75 percent of viewers won’t bother to return to it."
http://www.ianbrodie.com/get-clients-online/lose-website-visitors-in-5-minutes/
More important than size is following some simple rules and best practices.
Best Practices for Up Your Web Site
http://developer.yahoo.com/performance/rules.html
So a rough estimate would be
限制 10 个 TCP 数据包 (~14 kb)
https://developers.google.com/speed/docs/insights/mobile
limit 10 TCP packets (~14 kb)
https://developers.google.com/speed/docs/insights/mobile
确实取决于页面。如果您的页面内容丰富,那么您将拥有大量 HTML(文本)内容。但如果您的页面更加图形化(例如显示产品图像的商店部门页面),您将拥有大量图像。
图片比文字重得多(单个图片可能有 50K,相当于 10 页文字)。
您还需要考虑 CSS 文件、javascript 等的大小。但它们会被缓存,因此它们只对初始“加载”起作用。
话虽如此,您可以将每页最大 100-200k(混合文本/图像)的目标设置为。超过这个数量且速度较慢的连接将需要一段时间才能加载。
很可能您不知道谁将访问您的页面(移动、宽带或拨号),因此您应该尝试达成共同点(或为不同的目标设计不同的页面,但从长远来看,维护起来很痛苦随着您的网站扩展)。我认为大多数情况下 100-200k 就可以了。
如果您的页面一定很大,您仍然可以实现这一点,您可以使用一些技巧,例如图像压缩(使用 90% 质量的 JPG)、javascript/ajax 按需加载内容、缩小文件(CSS、javascript )、使用站点压缩(gzip)等。
Depends on the page really. If your page is an informative one, you'll have lots of HTML (text) content. But if your page is more graphical (like a store department page showing images of products), you'll have lots of images.
Images are much heavier than text (a single image could be 50K, which is like 10 pages of text).
You also need to consider the size of CSS files, javascripts, etc. But they're cached so they only matter for the initial 'load'.
Having said that, you could set a target of 100-200k (mixed text/images) max per page. More than that and slower connections will take a while to load.
Most probably you don't know who's going to visit your page (mobile, broadband or dialup), so you should try to reach a common ground (or design different pages for different targets, but this is a pain to maintain in the long run as your site expands). I think 100-200k is ok for most cases.
If you have pages that are necessarily big, you can still achieve this, there are several tricks you can use, like image compression (using 90% quality JPGs), javascript/ajax to load content on demand, minifying the files (CSS, javascript), using site compression (gzip), etc.
你的“最大”尺寸确实取决于很多。
您的受众:
您的内容
功能
请使页面尽可能小。好的设计就是把东西拿走,直到只剩下你需要的东西。基本 HTML 应该有几 kb,CSS 也有几 kb,如果您要加载脚本和图像,请最后加载它们。
页面越小,您的网站加载速度就越快,这意味着您的用户会感觉更投入,并且您的页面会得到更好的索引。
用户响应时间:http://www.useit.com/alertbox/response-times。 html
Google 的响应时间:http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
Your 'maximum' size really depends on a lot.
Your audience:
Your content
The functionality
For any site though, keep your page as small as possible. Good design is about taking things away until you're left with what you need. The base HTML should be a few kb, the CSS a few kb, and if you're loading scripts and images load them last.
With a smaller page, your site loads faster, which means your users feel more engaged and your page gets indexed better.
Response times for users: http://www.useit.com/alertbox/response-times.html
Response times for google: http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
一般来说,只需遵循常识即可。
例如,您可能想要嵌入一些信息,以免客户端负担过重。
Generally, simply go with common sense.
For example, you might want to embed some information so that the client isn't overburdened.