Live data from Hacker News

Will serving real HTML content make a website faster?

blog.webpagetest.org

1–10 of 109 posts

Re: Will serving real HTML content make a website faster?

#2
Shouldn't we have more devices and more connection types to have a more controlled experiment?

It's always 4G, mobile Chrome and I assume the same device.

Very likely same carrier at the same place, so roughly same connection conditions in terms of latency DL/UL bandwidth and jitter. Also always the same device with same CPU/GPU. Perhaps a flagship new shiny phone with a superfast SoC which gives a headstart to faster JS execution? Or perhaps a very spotty barely 1-bar 4G connection. (Just assumptions, maybe both are false, but you get the idea)

I'm a bit fan of client-side generation using JS too but I don't think this experiment is exhaustive of many practical scenarios.

If we see more connection types and more variety of devices with different CPUs then it'd be more convincing.

Re: Will serving real HTML content make a website faster?

#3

Shouldn't we have more devices and more connection types to have a more controlled experiment? It's always 4G, mobile Chrome and I assume the same device. Very likely same carrier at the same place, so roughly same connection conditions in terms of latency DL/UL bandwidth and jitter. Also always the same device with same CPU/GPU. Perhaps a flagship new shiny phone with a superfast SoC which gives a headstart to faste…

4G on a Moto is basically the worst case scenario but also how half the world interacts with the internet at large. If you're going to pick one scenario that describes a lot of users, they're pretty much dead on.

Re: Will serving real HTML content make a website faster?

#5

Shouldn't we have more devices and more connection types to have a more controlled experiment? It's always 4G, mobile Chrome and I assume the same device. Very likely same carrier at the same place, so roughly same connection conditions in terms of latency DL/UL bandwidth and jitter. Also always the same device with same CPU/GPU. Perhaps a flagship new shiny phone with a superfast SoC which gives a headstart to faste…

Some of the tests in the article are run on Desktop Chrome using a "cable" connection speed instead of 4G, which looks to have about a 6x faster round trip time than their 4G does. Those results are a little less impactful but still significant (many seconds faster still in some metrics).

More testing environments would make the results more or less significant, as you'd expect.

In ideal browsing conditions, the impact will be more minor, and in the spotty barely 1-bar connection you mention, the difference would be much more dramatic than the 4G examples in the post.

Re: Will serving real HTML content make a website faster?

#6
The large failing with this test is that it assumes the time to get the relevant page data from the database and render it to HTML is 0. If Twitter had your feed ready to go from its cache this might be accurate, but realistically I would give the server a few seconds to do its work since the site is so personalized.

Re: Will serving real HTML content make a website faster?

#7
Time for a hot take:

You don't need to make your website fast, all you have to do is not make it slow in the first place.

Partially or fully generating a web site client side can be plenty fast, the slowness tends to come from using some bloated framework to do so.

Re: Will serving real HTML content make a website faster?

#8

The large failing with this test is that it assumes the time to get the relevant page data from the database and render it to HTML is 0. If Twitter had your feed ready to go from its cache this might be accurate, but realistically I would give the server a few seconds to do its work since the site is so personalized.

OK but you could maybe render static html frames and fill placeholders with pre rendered html as soon as it is available? (A bit like htmx can do)

Re: Will serving real HTML content make a website faster?

#9
I remember when single-page applications were all the rage. I was highly skeptical that they could beat just loading HTML, given that the performance benefits were all predicated upon amortizing the initial load cost over many page requests. It's a very risky bet given that a lot of sites don't have a lot of repeat traffic to begin with, unless you just so happen to be an application in the guise of a website.

Apparently my skepticism has been validated.

Re: Will serving real HTML content make a website faster?

#10

The large failing with this test is that it assumes the time to get the relevant page data from the database and render it to HTML is 0. If Twitter had your feed ready to go from its cache this might be accurate, but realistically I would give the server a few seconds to do its work since the site is so personalized.

As the article says, the first example in the post does include the time that it takes to go out and fetch the static HTML that swaps in, and it added about a second to the server response of the experiment run that doesn't show up in the control run. For a big distributed site, a second may be more time than it would really take to put together a dynamic response.

Even with that 1-second additional delay included though, the improvement in that first test is still large (over 8 seconds faster in those tests). If the experiment took a few seconds longer on the server, it still would be 5 or 6 seconds faster to render content than the control.

Post reply on HN