RailsConf 2023 - Building an offline experience with a Rails-powered PWA by Alicia Rojas

Learn how to build an offline experience with a Rails-powered Progressive Web App (PWA) at RailsConf 2023. Discover the benefits of PWAs, the key components involved, and practical strategies for implementing offline support, caching, and more.

Key takeaways
  • PWAs (Progressive Web Apps) are regular web applications that can be installed on a user’s device, providing a native-like experience.
  • PWAs combine the best of native and web worlds, reaching a wide audience while offering enhanced capabilities like offline support.
  • To build an offline experience with a Rails-powered PWA, you’ll need to set up a service worker, an app manifest, and implement caching strategies.
  • The service worker acts as a bridge between the web app and the browser, intercepting requests and handling them accordingly.
  • The app manifest is a JSON file that provides information about the PWA, such as its name, icon, and scope.
  • Caching strategies can be used to store assets and data locally, allowing the app to work offline.
  • Stimulus.js can be used to enhance the app’s functionality and provide a more interactive user experience.
  • IndexedDB is a JavaScript API that allows you to store data locally in the browser, making it suitable for offline storage.
  • Background synchronization can be used to ensure that data is synced to the server when a network connection becomes available.
  • Server-side rendering can be used to generate static HTML pages that can be cached and served offline.
  • PWAs can provide a number of benefits, including improved performance, enhanced reliability, and a more engaging user experience.
  • It’s important to consider the specific needs of your audience and the platform-specific requirements when building a PWA.