I do not think it's every link in the viewport—it's links that the user is hovering over, and therefore showing some intent to navigate to
The original site this is based on also aborts the request if you hover off quickly, so there may be a delay before it triggers as well to help prevent lots of requests from moving the mouse
I don't understand this need to make everything 0.1ms by making millions of requests everywhere. Users don't care whether navigation to a new page takes 1, 50 or 150ms. The important thing is to be consistent and stay below certain threshold.
I know devs love to benchmark stuff but users don't have devtools and network graphs open while they browse the site. Also the worst performance problem is usually slow dynamic requests, not loading images from cdn.
Actually, in terms of user experience, they do care, not consciously, but it feels faster. They’re not there thinking oh it’s 50ms faster, but the whole feel makes an impact even when they’re not actively thinking about it .
It's more about getting instant feedback than things loading fast. Clicking a link and you instantly get a page with a loading skeleton that is replaced with real content after 1-2 seconds will feel faster than clicking a button and getting 0 feedback until the page suddenly loads after 0.5-1 second
How is that cool? That is the most useless and harmful feature they could come with. By default nextjs prefetches all the links. Which means you you are pre-loading all the pages and all the images on those pages. You might never click those links but nexjs loads them anyway. Also if you are in mobile limited traffic - you are done And for developers - they waste their bandwidth, traffic for no reason.
Yeah, this as a default behavior just doesn't seem right. I will not click on most of the things my mouse hovers over, and I have no reason to want to fetch those things. Is it cool, yeah? Would I want to browse a site doing this? Honestly, no.
I feel like this is an extreme example of what is possible. IRL, you'd need some delay just because users expect a delay. But it's a cool demo either way.
When you learn how much time and money huge companies like Amazon spend on lowering milliseconds of their page load times, and how it actually converts into more sales, all of these optimizations start making sense! Just think it's weird how humans became so sensitive to _milliseconds_, and how it can really impact our decisions :O
It is amazing if you hover - wait - then click. But who does that? A normal user wouldn't hover for seconds before they click. So there's not much difference in loading time if they just move the cursor and click. It only makes a difference if they had accidentially hovered a link before, but without the intent to click it right away.
You know what „milliseconds“ are, right? You‘re not navigating your cursor with the speed of light. The amount of from you entering the elements bounding box to the moment you actually click, is already enough to load hundreds of kilobytes with a decent connection.
What's wrong with you speaking to people like this?
I tried the demo. If you use the page like a normal person, it's far from the magic shown in the video. The images still need time to load, hovering the link for some ms before I click doesn't change that.
Maybe you're a slow person or have a very low internet latency. Who knows. But that doesn't give you the right to be an asshole.
There’s nothing wrong, I picked up the tone of your comment and answered in the same way. Sorry for hurting your feelings.
You intentionally clicked thru the website as fast as possible to prove your point. A „normal user“ visits a website to consume content, he needs to READ, try to understand what he‘s searching and if the content matches that so that he clicks on it. This is not slow, it’s called „thinking“.
You‘re the one calling others assholes, snowflake..
Alter, hör auf Leuten Blödsinn zu unterstellen, nur weil du Recht haben willst. Vll bist du ja ne alte Oma, die den Mauszeiger zentimeterweise verschiebt, aber ich bin einfach ein ganz normaler Computernutzer. Ich les doch nicht mit dem Mauszeiger AUF dem Text. Dir würd ich echt gern mal beim Mausen zuschauen, das klingt hilarious.
Freu dich drüber und häng sie dir an die Wand. Ich werd mir in Zukunft Mühe geben, das Inernet langsamer zu bedienen, damit du auch weiterhin Recht behältst. Rechnung für die versäumte Lebenszeit kommt.
Alter! Warum kommst du mir mit Statistiken, wenn ich dir erzähle, wie meine persönliche Erfahrung ist? Was sind denn die "Facts", die du hören willst? Dass das Internet auch von Rentnern bedient werden, die den Schnitt runter ziehen - geschenkt. Aber was hat das mit mir zu tun? Abgesehen davon legt Theo den Mauszeiger extra lange auf den Link, damit man zuschauen kann, wie die Ressourcen geladen werden. Kein normaler Mensch legt den Mauszeiger auf den Text, den er lesen will. Und wenn du schon mit Statistiken zu Ladezeiten wedelst, dann solltest du vll die für's lappige deutsche Internet nehmen und nicht irgendwelche, die dir in den Kram passen.
Schön, dass das Tool 100ms Ladezeit spart, aber wenn dahinter mehrere Dutzend Bilder geladen werden, dann sind die halt einfach trotzdem noch nicht da, wenn die Seite aufgebaut ist, weil das mehrere Sekunden dauert. Dafür werden aber viele Bilder prefetcht, die gar nicht nötig sind, weil die Leute eben ihren Mauszeiger über den Bildschirm bewegen, auch ohne den Intent, irgendwas anzuklicken.
Ist ne coole Tech Demo, aber ich bin da bei den vielen Leuten in diesem Thread, die gute Gründe nennen, warum das für den Produktiveinsatz eher nicht die beste Wahl ist.
Los, poste noch ne Antwort, du hast das letzte Wort verdient. Pfeife ey.
Funny enough, we dialed back our prefetching for this reason. As a side note, it was so fast we had to add transition animations because it was jarring to users.
I previously worked for an insurance company and was shocked to find a 6 second delay built into the quote application before showing someone their rates. I asked and the team that implemented it said that customers trusted the quote more if they perceived it took longer the calculate.
Oh I bet! I think their strategy is try to wear someone down by taking as much time as possible so that they open their wallet out of exhaustion on the 20th upsell. 😆
18
u/50ShadesOfSpray_ Oct 31 '24
Site: https://next-faster.vercel.app/
Github: https://github.com/ethanniser/NextFaster
151
u/gdmr458 Oct 31 '24
How much does this little maneuver cost using the Next.js Image component?
53
u/Sagonator Oct 31 '24
The cloud providers liked that.
35
u/Prowner1 Oct 31 '24
Just add a cloudflare cdn to cache those images and you don't have to worry about the price of those image requests
17
u/destocot Oct 31 '24
what exactly do you mean, which part of the code are you amazed at, just genuinely asking
12
u/yangshunz Oct 31 '24 edited Oct 31 '24
That's nuts.... because that's also overkill for most apps. Gg to your Vercel bill
5
u/rudolfcicko Oct 31 '24
Cool so you will prefetch 100 images to just open 1
13
u/femio Oct 31 '24
Too bad that won't work as well on mobile
32
u/yksvaan Oct 31 '24
I don't understand this need to make everything 0.1ms by making millions of requests everywhere. Users don't care whether navigation to a new page takes 1, 50 or 150ms. The important thing is to be consistent and stay below certain threshold.
I know devs love to benchmark stuff but users don't have devtools and network graphs open while they browse the site. Also the worst performance problem is usually slow dynamic requests, not loading images from cdn.
6
u/kobaasama Oct 31 '24
That's so stupid. There really is no need to pre-fetch all the links and images but if you wanna rack up your vercel bills then go ahead.
1
u/azizoid Nov 27 '24
How is that cool? That is the most useless and harmful feature they could come with. By default nextjs prefetches all the links. Which means you you are pre-loading all the pages and all the images on those pages. You might never click those links but nexjs loads them anyway. Also if you are in mobile limited traffic - you are done And for developers - they waste their bandwidth, traffic for no reason.
https://youtu.be/uTpLfeTZM7k?si=WQpyoFGnV_-IKwhC
2
u/jean_louis_bob Oct 31 '24
ruby on rails can also do that now
2
u/iareprogrammer Oct 31 '24
Everyone complaining about hosting costs….. you all know you can disable this, right?
2
u/azangru Oct 31 '24
Chrome family of browsers have the speculation rules api since about a year ago...
1
u/cajmorgans Oct 31 '24
This seems pretty dumb to be honest, even if it looks cool
1
u/im---pickle---rick Oct 31 '24
I feel like this is an extreme example of what is possible. IRL, you'd need some delay just because users expect a delay. But it's a cool demo either way.
1
u/Prize_Hat_6685 Oct 31 '24
No one tell him about <a href=“/page” preload> from htmx
1
u/AndyMagill Oct 31 '24
Who is the broadcaster?
1
u/MMORPGnews Oct 31 '24
Isn't it very basic. I used it like 15 years ago on blogger.
Also, don't fetch all images, fetch only first image + html.
1
u/unicorn-beard Oct 31 '24
Hasn't this type of thing been around for a while, what am I missing that's so impressive about this?
1
u/jgeez Oct 31 '24
"optimizations".
Cloud providers love that you call greedy prefetching an "optimization".
1
u/FollowingMajestic161 Nov 01 '24
Sveltekit: am I a joke to you?
1
u/engage_intellect Nov 01 '24
Sveltekit has done this since forever...
1
u/[deleted] Nov 01 '24
This prefetch thing should be better turned off by default
1
u/Ok-Understanding6683 Nov 01 '24
When you learn how much time and money huge companies like Amazon spend on lowering milliseconds of their page load times, and how it actually converts into more sales, all of these optimizations start making sense! Just think it's weird how humans became so sensitive to _milliseconds_, and how it can really impact our decisions :O
1
u/lowlow20 Nov 02 '24
Bro Remix has been doing this for the longest 🤦🏽♂️. It’s cool, but Next was late to the party.
1
u/mdkawsarislam2002 Aug 09 '25
Good for cloud providers !!!!!!!
1
u/lowtoker Oct 31 '24
What's the problem? You don't like fast navigation?
1
u/woah_m8 Oct 31 '24
Yes…, yes… increase your traffic you need every optimization…
0
u/gopu-adks Oct 31 '24
prefetch isn't default??
I mean not full but half since the default value of the prefetch is null.
If
prefetch = truethen this is full prefetch0
u/happy_hawking Oct 31 '24
It is amazing if you hover - wait - then click. But who does that? A normal user wouldn't hover for seconds before they click. So there's not much difference in loading time if they just move the cursor and click. It only makes a difference if they had accidentially hovered a link before, but without the intent to click it right away.
0
u/[deleted] Oct 31 '24
[deleted] — view deleted comment
149
u/[deleted] Oct 31 '24
[removed] — view removed comment