When developing an SPA you must:
Address the first-hit problem: This refers not to the size of the framework (they compress very well) or the low cache hit ratio on mobile devices but to the “loading” of the framework. It is an expensive process and can make the experience unbearable in mobile. If your site has many first-time visitors or multiple points of entry (search engine or referred traffic, bookmarks, etc.), you might want to consider server-side rendering.
Measure what is relevant: The onload event triggers when the page first loads, and it is not invoked again for virtual pages. (The onload most likely triggered before the page became interactive.) You cannot optimize what you cannot measure. To solve this problem, tag your code using W3C’s User Timing specification. Implementing custom metrics is not very hard and is already supported on WebPagetest.
Boris Livshutz has spent over two decades making enterprise applications run faster. Boris is an enterprise architect at Akamai working on improving the performance of some of the world’s largest websites. Previously, he ran the Center of Excellence at AppDynamics, where he developed best practices for using performance monitoring tools to improve the speed and reliability of large sites and helped them scale in the cloud. In his earlier years, Boris worked at startups and then at Oracle, building database and data warehousing products for enterprise customers.
Manuel Alvarez is an enterprise architect at Akamai, where he focuses on designing complex technical solutions over a variety of technologies and driving business objectives by implementing solutions aligned with the organization goals with proven ROI, such as implementing advanced caching techniques to reduce platform costs. Over his career, Manuel has worked on large projects with financial institutions, high-tech companies, and telecommunication services across multiple geographies.
©2016, O'Reilly Media, Inc. • (800) 889-8969 or (707) 827-7019 • Monday-Friday 7:30am-5pm PT • All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. • email@example.com