Re:WebP: The WebPage Compression Format
by BugsJustFindMe on Saturday September 07, 2024 @02:56PM
(#41475666)
It takes more time for your message to get back and forth between your computer and the server than it takes for the server to pump out some extra bits.
Even if you transmit the js stuff inline, the op's notion of time still just ignores the fact that it takes the caller time to even ask the server for the data in the first place, and at such small sizes that time swallows the time to transmit from the user's perspective.
Re:WebP: The WebPage Compression Format
by Retr0id on Saturday September 07, 2024 @03:12PM
(#41475772)
Here's a demo that only uses a single request for the whole page load: https://retr0.id/stuff/bee_movie.webp.html
It is technically 2 requests, but the second one is a cache hit, in my testing.
Re:WebP: The WebPage Compression Format
by BugsJustFindMe on Saturday September 07, 2024 @03:15PM
(#41475791)
That's fine, but if you're evaluating the amount of time it takes to load a webpage, you cannot ignore the time it takes for the client request to reach your server in the first place or for the client to then unpack the data. The time saved transmitting such a small number of bits will be a fraction of the time spent making that initial request anyway. That's all I'm saying.
OP is only looking at transmit size differences, which is both not the same as transmit time differences and also not what the user actually experiences when requesting the page.
Re:WebP: The WebPage Compression Format
by purplesyringa on Sunday September 08, 2024 @04:12AM
(#41478959)
Hmm? I'm not sure where you're taking that from. The webp is inlined.
Edit: Ah, I see OP's code requests the webp separately. You can avoid the extra request if you write a self-extracting html/webp polyglot file, as is typically done in the demoscene.