Live data from Hacker News

Browsers are pretty good at loading pages

carter.sande.duodecima.technology

151–160 of 328 posts

Re: Browsers are pretty good at loading pages

#151

Earlier quoted context omitted.

"You don't have to download all the content again" is also true if you version your assets and use a CDN with far-future expiry headers. If you need an HTTP connection to download a section of HTML for a new part of an SPA it won't be that much different from a full page of HTML, presuming you compress the transfer as you should. "Of course shitty implementations exist" is true of a non-SPA setup too.

While it's true that the browser won't have to download the content again, it will have to re-instantiate various resources (eg execute all JavaScript over again..., restart gifs). If implemented correctly, JavaScript navigation should seamlessly appear like normal navigation. Not supporting streamed requests is a serious drawback. Of course browsers have actually gotten pretty good at AJAX-like loading instead of co…

> While it's true that the browser won't have to download the content again, it will have to re-instantiate various resources (eg execute all JavaScript over again..., restart gifs).

Your JavaScript shouldn't be blocking page load anyway. Defer, defer, defer.

Re: Browsers are pretty good at loading pages

#152

Earlier quoted context omitted.

Case in point, navigation on my site is pretty fast (to me, at least) and doesn't use much JS at all: https://www.stavros.io (I promise I'll reply to your email soon)

It's not as fast as https://dev.to/ , which is an SPA. I.e. client side routing.

And it took me 2 minutes clicking around to break its idea of the page state. I am partially scrolled down the home page, and it just decided to deactivate scrollbars and the ability to scroll.

A great example of how it's quite difficult to reimplement stuff that works perfectly well on traditional pages.

(At least they seem to haven gotten rid of some of the dark patterns they had in the past, that's nice to see)

EDIT: and within a minute more found another state bug :D

Yes, you can make perfect SPAs, but many people fail and it's a good question if the effort required to do it properly is worth it.

Re: Browsers are pretty good at loading pages

#153
post #14

Modern web is all about bloat and ever complicated ways of doing the meaningless things and how to make a web page more expensive and slower by far than applications that did 10 times 10 years ago. Web has good things going for it biggest being the nearly universal access across devices and platforms but bloat free is not one of them. It might be fast but I feel like it's never going to be efficient in my lifetime. A…

Yes, it is true. It is too complicated and messy, and also stupid. There are other file formats (e.g. plain text) and protocols for other purposes anyways, which is sometimes useful.

Re: Browsers are pretty good at loading pages

#154

You can also make a mess of server side nav. Just take a look at PyTorch documentation: 2.5MB of shit loaded in 26s. At least 10 fonts, 300KB of CSS and 455KB of JS. What I hate most about it is that the 'in page search' function doesn't work for many seconds after the page starts showing, and it's the only way to navigate such a long-ass page. Even with such a huge page most functions have no example of usage, it wa…

And the rustdoc for Iterator [0] (everything else is great, though).

[0] https://doc.rust-lang.org/std/iter/trait.Iterator.html

Re: Browsers are pretty good at loading pages

#155

Earlier quoted context omitted.

Case in point, navigation on my site is pretty fast (to me, at least) and doesn't use much JS at all: https://www.stavros.io (I promise I'll reply to your email soon)

It's not as fast as https://dev.to/ , which is an SPA. I.e. client side routing.

It is fast, but it breaks even faster. Managed to get myself in locked up state in some 15 seconds. Couldn't go back, displayed page was incomplete but no scrollbars were to be seen.

Re: Browsers are pretty good at loading pages

#156

Earlier quoted context omitted.

Because it's faster. If you don't have to download all the content again, force the browser to re-render everything, then by design you just get the new content from the server faster, if you have to download anything at all. The idea exists since the introduction of AJAX. Furthermore, you don't lose state, which makes things much more simple. Imagine a simple image gallery. You just update the tag, update the URL wi…

> Because it's faster. In my experience sites with these kinds of navigation are typically extremely slow with initial page loads taking anywhere from a couple seconds (bad) to 10-20-30 seconds, sometimes even a minute (on a 100 MBit/s connection) and subsequent navigations are often slow as well. It can be hypothetically faster, because you can theoretically get away with less data transfers and less client work, bu…

Reminds me of JIT compilation, with the large initial load cost and the theoretical-but-mostly-unmaterialized reasons it could be faster.

Re: Browsers are pretty good at loading pages

#158

I don't get client side navigation. It's a worse experience in every way. It's slow, often doesn't support things like command-click, it usually breaks the back button, and even if it doesn't it breaks the restoration of the scroll position. The only thing worse is a custom scroll UI. Why do people try to reinvent the most basic features of a webbrowser? And if they do, why do they always only do a half-assed job at…

Because it's faster. If you don't have to download all the content again, force the browser to re-render everything, then by design you just get the new content from the server faster, if you have to download anything at all. The idea exists since the introduction of AJAX. Furthermore, you don't lose state, which makes things much more simple. Imagine a simple image gallery. You just update the tag, update the URL wi…

Do modern browsers really re-render everything without optimizations?

Re: Browsers are pretty good at loading pages

#159
post #62

Earlier quoted context omitted.

Its also really not that hard to make cmd click + back button to work properly with client side nav.

Can you support iOS's "peek" menu as well?

Is there anything special needed to support that? I’m pretty sure you just need an tag with an href. With any SPA framework/library I’m aware of, you have to go out of your way to make it not work.
Post reply on HN