Check out all the web sessions at Google I/O → goo.gle/io24-web-yt
@karlijnlowik14357 ай бұрын
Really interesting, thanks Barry!
@schmushenmush7 ай бұрын
at 15:10 you show an example of multiple prerender rules, but show a single object with the "prerender" key set twice. Surely that can't be right? I assume there should be one "prerender" key whose value is an array of rule objects?
@tunetheweb7 ай бұрын
That works too! There are quite a few ways to include multiple rules: developer.chrome.com/docs/web-platform/prerender-pages#multiple-speculation-rules
@tunetheweb7 ай бұрын
Actually sorry, you're right. That only works with different keys (prefetch and prerender)! There's also quite a few other things wrong with that slide (url should be urls, and single quotes should be double quotes). Shouldn't have done this last minute addition!!
@philadams92547 ай бұрын
Advertisers and trackers are going to love this
@tunetheweb7 ай бұрын
As explained in the video, Google Analytics, GPT, and Google AdWords already support this API and will hold of registering views until the page is activated. As usage of this API grows we envisage other analytics and ad providers doing similar by default, but in the meantime these can be manually delayed with the APIs discussed in the video. Additionally, third-party s not being loaded during the prerendering phase will also help.
@googletjanster29177 ай бұрын
Matomo > Google Analytics
@danilaplee7 ай бұрын
nice job yeah i immediattely thought about preloading my huge spa when the user hits the index page
@francescinvernon7 ай бұрын
What about the increase of data transfer on the CDN's? It's worth ?
@ozgurNY6 ай бұрын
Nonesense. It is worth it because I prefer client devices to handle all prerendering than paying to server companies
@francescinvernon6 ай бұрын
@@ozgurNY What I mean is that when I tested the speculation rules, instantly our CDN data transfer increased very significantly.
@tunetheweb6 ай бұрын
@@francescinvernon Definitely should try to only prerender when theres a high probability of user actually visiting that page (in which case there should be little increase in costs since it was costs you were going to pay anyway). Document rules with a moderate/conservative eagerness is one of the easiest ways of doing this but with less of a lead time. Also ensure your resources (including the pages themselves!) are cacheable to avoid having to refetch from CDN each time.
@francescinvernon6 ай бұрын
@@tunetheweb ok i'l try with moderate/conservative eagerness and test the CDN thankss !
@philadams92547 ай бұрын
22:50 - shouldn't these really be in MB of data instead? You could do very little with 50 or a lot of damage with just 2
@tunetheweb7 ай бұрын
An interesting idea! As discussed in the talk, the various precautions we have added to Chrome (using the HTTP Cache, this being primarily for same-origin, not loading cross-orgin s which are often heavier content...etc.) means that the cost is often smaller than you think. But even without a heavy network cost, there can be CPU cost so I think a limit on the number of navigations makes sense, but maybe there should also be a MB cap? You could suggest that here: github.com/WICG/nav-speculation/issues
@JacobGextrem7 ай бұрын
Very awesome talk! can't wait to see more of what Cloudflare is going to do with ML & spec rules. reminds me of guess.js, just a 2024 variant of it
@brunomachado36907 ай бұрын
Does anyone know the name of the code editor theme used in the presentation?
@philadams92547 ай бұрын
25:32 - What happened in February of 2022?
@tunetheweb7 ай бұрын
Not sure to be honest. Please raise an issue at github.com/HTTPArchive/httparchive.org if you want this investigated further.
@msahu25957 ай бұрын
Wonderful ❤❤
@williamtanardi39527 ай бұрын
Indonesia mentioned, wellplayed Tokopedia
@ruslanmakarov70497 ай бұрын
Users with slow connection or who are charged by traffic give it a standing ovation.
@tunetheweb7 ай бұрын
Slow connections is an interesting one. In some ways those are the very connections that can benefit most from this (providing they don't contend with the current navigation). As to the charges concern, the Speculation Rules API honours the Save-Data setting, and also Preloading can be turned off plus, as noted in the talk, the cost of these navigations of often less than you think for various reasons I cover. Using a standardised API allows the user-agent to be more of an "agent for the user" for these features.
@ruslanmakarov70497 ай бұрын
@@tunetheweb “ Preloading can be turned off”. - How? How do you expect a housewife and 99% of other users to get into browser settings and change something? Let's imagine a user on 3G or satellite internet with distribution via WiFi with a tariff of $80 for 1Gb, who visited a page, and the owner of that website immediately without asking for permission starts loading on his device half of his site, completely clogging the channel and CPU (rendering). You think about developers and users with good internet, and you are killing users with not so good or expensive internet, and there are a lot of them.
@jehanzebn7 ай бұрын
Speculation rules for flutter web?
@sidawei7 ай бұрын
Not in USA, access ray-ban still now shows speculation rules. Does any other pages we can see it in real world? or demo page
@tunetheweb7 ай бұрын
Try the demo page at 18:20 (can't seem to post the link without my reply being swallowed up!)
@lenn14407 ай бұрын
I am curious why they choose for the script tag and not just put it somewhere in the head of the document seems to me to be more logical to me. And also isn’t this just going to nuke performance. because a lot of low end pc’s and phones can beryl handle some modern websites. And how is this going to interact with the JavaScript you already have to do updates or others stuff? And I often times see more issues in the network stack because of WiFi and others than this.
@tunetheweb7 ай бұрын
The script element can go in the head. A prerender happens in a separate process, so a separate main thread. And on low-end devices and with certain settings, speculations will not be enabled-as mentioned in the video.
@lenn14407 ай бұрын
@@tunetheweb yes you’re are correct but I was more thinking of like a meta tag why not that. And I am curious how can a server know if the users supports the feature or do you just have to look against the browser version
@tunetheweb7 ай бұрын
@@lenn1440 That has been suggested: github.com/WICG/nav-speculation/issues/307. Personally I prefer the JSON syntax and find it easier to read-particularly for complex rules. and meta tags are fine for simple declarations, but quickly become unwieldy for more complex ones. But follow along with that issue to see if we change approach on that. The server can know with a header when a speculation happens (developer.chrome.com/docs/web-platform/prerender-pages#detect-server-side) but doesn't know before it happens, and to be honest, doesn't really need to know-just serve the speculation rules anyway.
@lenn14407 ай бұрын
@@tunetheweb hi I am going to track the issue you linked and I might comment at some point if something interesting happens. I think I prefer the html syntax more just because most of the stuff I build is just html with a little js
@philadams92547 ай бұрын
21:50 - this example is only valid if the user spent more than 11.460s on the previous page. Who would really do that (in most cases) though?
@tunetheweb7 ай бұрын
I don't think this is an unrealistic example for a large listing page with eager preloading (as Tokopedia do). And the API picks up where the user left off so if you get a 5 second head start, then you go from an 11 second render to a 6 second render-still a much better user experience. Additionally, this extreme example (as noted in the video) is over 3G. With a faster network the load time will be less.
@philadams92547 ай бұрын
@@tunetheweb Thanks for responding to all the questions here
@tommywheel3 ай бұрын
Hopefully this way webdevs stop feeling the need for SSR as the default to improve page load performance. Everyone should learn to leverage the browser engine to its extreme.
@daleryanaldover65457 ай бұрын
Sveltekit already does this by default. It's nice to see chrome is keeping notes.
@komodoutd7 ай бұрын
Man, so nice to see Victor Orban switching to tech
@portosmd99877 ай бұрын
This is just his hobby. Pure genius.
@xorlop7 ай бұрын
I wish the mobile story was talked about. There is no hover on mobile. I am doubtful this has any benefits for mobile.
@tunetheweb7 ай бұрын
As noted in the video we are working on better heuristics for mobile. For URLs with a high probability of being visited these can be loaded eagerly. Where that's not possible even the small time between touch down and the navigation starting DOES improve loading speed on mobile. Not as much as hover of course, but given how simple it can be to implement the API, even a small head start is useful.
@xorlop7 ай бұрын
@@tunetheweb Wow, thank you so much! I am sorry I must have missed it. That is really cool. Thank you!
@repotranstech7 ай бұрын
Combine this with htmx and a server side framework like Django or spring you are good to go.
@vadergrd7 ай бұрын
cls ...something that really annoys me ...
@StevenDavisPhoto6 ай бұрын
"Not for SPA's". That's like most of the web these days.
@stephenkamenar7 ай бұрын
why are we cheering about 78ms !? the page is already PRE RENDERED how is it not like ... idk, 0ms?
@tunetheweb7 ай бұрын
It's about as close as you're going to get! You still need to swap the old page for the new page AND actually paint the pixels. 78ms is 0.078 seconds-literally less than the blink of an eye!
@stephenkamenar7 ай бұрын
@@tunetheweb i guess web people aren't familiar with how a computer works. but you can calculate and paint all the pixels of a complex 3d environment on a 4k monitor in like what, 4ms? just look at any video game
@duytdl7 ай бұрын
Why are you presenting it like a new thing you've invented? You're just implementing this "tech" that devs have been using for probably at least 5-10 years since jQuery days... Preloading next content ain't new! Congrats for catching up and implementing it as a standard. But too little too late. People have moved on to frameworks that solve this in a much more seamless way with their framework of choice (eg. next/remix, I'm sure there are others)
@eamax7 ай бұрын
It's not about being the first, it's about having a better solution to the same problem.
@_____case7 ай бұрын
Because this is the first time this functionality is being exposed as a Web Standard Browser API.
@tunetheweb7 ай бұрын
As mentioned in the video, you are right that we HAVE had ways to prefetch content before, but not really for full navigations, and not for full prerendering (except for one earlier iteration in Chrome that no longer works for this). Frameworks can't prerender either (when they say "prerender" they mean "create the DOM server-side" rather than actually do the full browser prerender).
@user-tz9jh6pv2j7 ай бұрын
because frontend guys these days are just reinventing the wheel over and over. don't worry, there will be a new framework next week
@_____case7 ай бұрын
@@user-tz9jh6pv2j There's a big difference between "frontend guys" and the people who design Web APIs and build them into browsers.
@kost9kost7 ай бұрын
Terrible sound
@BehruzbekOtayev7 ай бұрын
My users didn't really care when I improved my site speed. It was barely noticeable. If your site loads within 5seconds max, you're fine.
@funkdefied17 ай бұрын
5 seconds is HUGE. What was your user base like?
@MehmetKoseDev6 ай бұрын
nice feature, worst naming
@captnoplan39267 ай бұрын
Will this not increase the carbon footprint? Imagine millions of websites implementing this and prefetching stuff that in the end will not get shown, since the user changed their mind.
@albanx17 ай бұрын
honestly I do not see value in this. This is going to die in the next 2 years as usual.