网页的大小是否有最大限制?

发布于 2024-11-16 07:13:14 字数 117 浏览 0 评论 0原文

当我说大小时,我指的是字节而不是像素。

我很好奇对于不同类别的最大尺寸是否有任何共识。具体来说:

  1. 宽带连接
  2. 拨号连接
  3. 移动连接

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:

  1. Broadband connections
  2. Dialup connections
  3. Mobile connections

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

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

发布评论

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

评论(6

等数载,海棠开 2024-11-23 07:13:14

尺寸并不代表一切。重要的是性能。更好的是:感知的表现。有很多方法可以让网站感觉比实际速度更快。其中一些技术甚至可以增加您的绝对页面大小(以字节为单位)(例如,向其中添加更多 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.

铁憨憨 2024-11-23 07:13:14

根据您希望页面加载时间尽可能短的连接情况。
最佳时间小于 4 秒。

“领先的网络流量控制者 Akamai Technologies 进行的一项研究表明,设计不当的网站会在几秒钟内失去 30% 的客户。
同一项研究还发现,如果一个网站的加载时间超过四秒,75% 的观众就不会再返回该网站。”

http://www.ianbrodie.com/get-clients-online /lose-website-visitors-in-5-分钟/

比大小更重要的是遵循一些简单的规则和最佳实践。
升级网站的最佳实践
http://developer.yahoo.com/performance/rules.html

所以粗略的估计是

Broadband connections   ~200K
Dialup connections      ~50k
Mobile connections      ~100K

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

Broadband connections   ~200K
Dialup connections      ~50k
Mobile connections      ~100K
牵强ㄟ 2024-11-23 07:13:14

限制 10 个 TCP 数据包 (~14 kb)

由于 TCP 估算连接容量的方式(即 TCP 慢启动),新的 TCP 连接无法立即使用客户端和服务器之间的全部可用带宽。因此,服务器在第一次往返中可以在新连接 (~14KB) 上发送最多 10 个 TCP 数据包,然后它必须等待客户端确认此数据,然后才能扩大其拥塞窗口并继续传送更多数据。

由于这种 TCP 行为,优化您的内容非常重要
最大限度地减少交付必要的往返次数
data 来执行页面的第一次渲染。理想情况下,ATF 含量
应小于 14KB - 这允许浏览器绘制页面
经过一次往返之后。另外,值得注意的是,10
数据包 (IW10) 限制是 TCP 标准的最新更新:您应该
确保您的服务器已升级到最新版本
这一变化的优势。否则,限制可能是 3-4
数据包!

https://developers.google.com/speed/docs/insights/mobile

limit 10 TCP packets (~14 kb)

Due to how TCP estimates the capacity of a connection (i.e. TCP Slow Start), a new TCP connection cannot immediately use the full available bandwidth between the client and the server. Because of this, the server can send up to 10 TCP packets on a new connection (~14KB) in first roundtrip, and then it must wait for client to acknowledge this data before it can grow its congestion window and proceed to deliver more data.

Due to this TCP behavior, it is important to optimize your content to
minimize the number of roundtrips required to deliver the necessary
data to perform the first render of the page. Ideally, the ATF content
should fit under 14KB - this allows the browser to paint the page
after just one roundtrip. Also, it is important to note that the 10
packet (IW10) limit is a recent update to the TCP standard: you should
ensure that your server is upgraded to latest version to take
advantage of this change. Otherwise, the limit will likely be 3-4
packets!

https://developers.google.com/speed/docs/insights/mobile

最佳男配角 2024-11-23 07:13:14

确实取决于页面。如果您的页面内容丰富,那么您将拥有大量 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.

魔法少女 2024-11-23 07:13:14

你的“最大”尺寸确实取决于很多。

您的受众:

  • 他们拥有什么类型的连接
  • 他们期望什么加载时间 他们
  • 期望什么内容

您的内容

  • 您试图呈现什么内容

功能

  • 您的网站如何加载内容
  • 用户是否需要在网站中移动并获取多个内容 但对于任何网站,

请使页面尽可能小。好的设计就是把东西拿走,直到只剩下你需要的东西。基本 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:

  • What type of connection do they have
  • What load time are they expecting
  • What content are they expecting

Your content

  • What content are you trying to present

The functionality

  • How does your site load the content
  • Do users need to move through the site and fetch multiple pages regularly or are there large pauses before they move

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

为你鎻心 2024-11-23 07:13:14

一般来说,只需遵循常识即可。

例如,您可能想要嵌入一些信息,以免客户端负担过重。

Generally, simply go with common sense.

For example, you might want to embed some information so that the client isn't overburdened.

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