Home » All videos » News » Yesterdays perf best-practices are todays HTTP/2 anti-patterns - Velocity 2015 (Santa Clara)

Yesterdays perf best-practices are todays HTTP/2 anti-patterns - Velocity 2015 (Santa Clara)

Yesterdays perf best-practices are todays HTTP/2 anti-patterns - Velocity 2015 (Santa Clara) watch video online

Slides: bit.ly/http2-opt The limitations of HTTP/1.X forced us to develop various application workarounds (sharding, concatenation, spriting, inlining, etc.) to optimize performance. However, in the process we’ve also introduced numerous regressions: poor caching, unnecessary downloads, delayed execution, and more. HTTP/2 eliminates the need for these hacks and allows us to both simplify our applications and deliver improved performance – a rare combination! In this session we’ll take a critical look at how the current best practices came to be; the new features of HTTP/2 that make them obsolete; and what you need to do to deliver the optimal HTTP/2 experience: - Why you should unshard, unconcat, and unsprite your assets - Why you should switch from inlining to server push - What to look for in an HTTP/2 server for optimal performance - What new best practices are possible with HTTP/2 … plus other hands-on tips for getting the most out of HTTP/2 both on the server and the client.
More information video
Nerevarr Nerevarr · 0 movies
0 / 0
For the movie so far no one has voted...

Category video: News

Comments (7)
srcspider # 13 april 2018 in 20:00 0
26:00 the example is valid for css and images since there is no incremental loading strategy (with out migrating the css to javascript via loading or natively), but in the case of javascript using webpack you can have essentially a entry point files per page type then have partial files generated automatically for you that will add to the page the minimum required code for getting the page to work; in addition to still be a perfect gzip target.

The idea that "if you just change one file, you now don't have to hit everything" sounds good but in practice we care a lot more for initial cold load so its not really a great benefit. Also, the code does not change on a minute by minute basis (generally) for this to be an issue. And if it does change often just devide and conquer. Even today it's better to have a Some_Page.js and a Common_Parts.js then to have a single app.js.

Also, I've yet to see a http2 spec that details how exactly its able to gzip all the files togheter. Everything I've read basically has been a raise your hands in the air, give up, and just gzip individually. Many javascript libraries today are extremely small, so small that individually gziping it compared to gziping the whole thing is just a huge loss; some to the point where its so small (under 1kb) that gzipping makes them bigger. For some use cases this might be perfectly fine solution but not really a general purpose one.

Another big issue is manifests. The presentation says its better to split your js files as if the server can actually send all of them in one fell swoop, but servers are actually dumb and as far as I'm aware ES6 + http2 still requires the client to process dependencies then ask for the next files (eg. home.js might as for input.js then input.js might ask for ui.js which might as for an each and component implementation which in turn might as for some base iterator implementation, etc ...you get the idea). Packaging all in one package avoids the resolution and any sophisticated mechanism that would need to exist on http/server/client to resolve that. And by using something like webpack you get the benefit of still only grabbing the minimum required for the page to function and not some giant monolith.
Coding Lounge # 13 april 2018 in 20:04 0
@igrigorik Where could I find more info on server push? Graphs if possible to understand it more easy whats going on with the stream and how the PUSH_PROMISE is sent and the HEADERS and DATA frames?
Shree Prakash Shukla # 13 april 2018 in 20:08 0
Superb explanation @Ilya. It couldn't be perfectly explained and compared with HTTP/1.*. Great & Thanks a lot!
Филипп Борисов # 13 april 2018 in 20:13 0
How service worker will handle that server pushes? I mean, now we can check each request and watch it's resource, but how it will work if on one request i'll receive multiple resources?
Hr Gwea # 13 april 2018 in 20:18 0
What was the question at 45:00? I can't understand a single word.
Chris Williams # 13 april 2018 in 20:19 0
This is great.  Makes we wish Safari would catch up to HTTP/2 so I can fix my workflow across the board.
Ilya Grigorik # 13 april 2018 in 20:22 0
Yesterday's perf best-practices are today's HTTP/2 anti-patterns... Video of my Velocity talk from a few weeks back! If you want to quickly scan through the slides, see: bit.ly/http2-opt.