Is there a maximum size that web pages should be kept under?

后端 未结 6 1013
轻奢々
轻奢々 2021-01-07 19:27

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

相关标签:
6条回答
  • 2021-01-07 19:47

    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

    0 讨论(0)
  • 2021-01-07 19:52

    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.

    0 讨论(0)
  • 2021-01-07 19:52

    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

    0 讨论(0)
  • 2021-01-07 19:54

    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.

    0 讨论(0)
  • 2021-01-07 19:55

    Generally, simply go with common sense.

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

    0 讨论(0)
  • 2021-01-07 20:05

    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
    
    0 讨论(0)
提交回复
热议问题