- [Narrator] We've talked a lot about CSS…and how we can optimize performance for HTTP/2,…so now it's time to take a look…at how HTTP/2 impacts the way we load JavaScript…and how it can improve performance by using async and defer.…First of all, HTTP/2 makes JavaScript concatenation…pretty much unnecessary.…You'll remember, when a page loads in HTTP/1,…any time the browser encounters a JavaScript,…it stops rendering the page,…then downloads the JavaScript file,…then re-renders the page.…

And that means, if you had a ton…of different JavaScript files…and you can only download six at a time,…the JavaScript would stop…the rendering of the page constantly.…It would get what's known as Head-of-line blocking.…To combat this, we would concatenate…all the JavaScript files into one huge file,…and then just download that one huge file all the time.…But that became an issue because…we'd just download tons of JavaScript you don't need,…and these files are really huge sometimes.…So, in HTTP/2, we can solve that issue entirely…

Resume Transcript Auto-Scroll

Author

Released

9/30/2016

Performance matters! Faster websites have been shown to increase visitor retention, loyalty, and satisfaction, especially on mobile. The cause of most slowdowns is the communication between the browser and the server: the realm of HTTP. The new HTTP/2 protocol offers web developers huge performance enhancements, such as multiplexing, compressed headers, and Server Push. Learn how to optimize the performance of your websites using HTTP/2. Senior staff author Morten Rand-Hendriksen shows how to optimize images (one of the biggest resource hogs), code, and file caching, as well as server delivery and browser handling. Learn how to minify HTML, CSS, and JavaScript and use a content delivery network to speed up download times. Ditch the old and restrictive HTTP protocol and enter a new age of the lightning fast web.