The faster option
This new setup provides a good amount of flexibility, meaning the app can render “the exact same output independent of the location of the rendering”. Baxter says that the hard separation is no longer present and it’s far less likely for the server and client to be different than one another.
Without shared rendering logic we couldn’t have realized the potential of rendering only what was necessary on startup and everything else as data became available.
Their previous setup meant that visitors on Netflix.com would need to wait it out for the Java tier to generate the majority of the response needed for the entire page’s lifetime and deliver it as HTML markup. “Often, users would be waiting for the generation of markup for large parts of the page they would never visit”.
By bootstrapping the client view, less gets loaded and a visitor’s waiting time is reduced, with the team able to easily change the amount of the total view the server generates. On top of the reduction in processing time on the server, the team have also benefitted from their rendering being consolidated into one language.
Baxter also mentioned that while performance work is still ongoing, Netflix would be looking into Service Workers, ASM.js, WebAssembly and other web standards to contribute to a better website experience for users.