Maximiliano Firtman's articles, notes and learning experiences for devs-firt.dev

The Mysterious Life of Web Apps in the Background

A research to understand what happens with our sites and PWAs when they are not visible on desktop or not active on mobile

by Maximiliano Firtman Twitter @firt About Newsletter

#talk #android #ios #pwa

Session delivered during CityJS Conference 2020 (online), September 2020.

Do you know what happens with your code when the user presses the home button, or reply to a WhatsApp message while using your web app or website? Let's spy on the lifecycle of web apps today and uncover the secrets of their mysterious life in the background.

When coding web apps, understanding the life cycle is crucial to offer the best possible experience. In this session, we will analyze the lifecycle of a web app on the desktop, Android, and iOS in different scenarios, such as what happens in the background on standalone PWAs, and browser's tab.

We will analyze the Page Visibility API and the Page Lifecycle API with real-world examples, including how to save and restore the app's state using new DOM events (resume and freeze).

Understanding this mysterious life in the background will help us understand how to save battery, how to deal with games, timer-based tasks, and animations. We will see examples in real-time on how different browsers react with standard timers, requestAnimationFrame calls, Web Workers and Service Workers when the web app goes to the background.

If you liked this article, you can support me by a PayPal donation, or buying me a coffee. You can subscribe to my newsletter to get updates (no spam). [フレーム]

Learning experience by Maximiliano Firtman. He is a mobile + web developer, trainer, speaker, and writer. He has authored many books, including High Performance Mobile Web published by O’Reilly Media. He is a frequent speaker at conferences worldwide and he has been widely recognized for his work in the mobile-web community. He teaches mobile, HTML5, PWA and performance workshops for top companies around the world. He published several online courses on Mobile App Developmement, Progressive Web Apps and Web Performance at many online publishers, such as Pluralsight, Linked Learning/Lynda, Frontend Masters and O’Reilly Learning. Twitter: @firt

AltStyle によって変換されたページ (->オリジナル) /