SlideShare a Scribd company logo
OFFLINE PWA
JOURNEY TO THE FUTURE
WHY PWA?
FAST - Respond quickly to user interactions with
silky smooth animations and no janky scrolling.
RELIABLE - Load instantly and never show the
downasaur, even in uncertain network conditions.
ENGAGING - Feel like a natural app on the
device, with an immersive user experience.
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVICE WORKERS
▸ Runs separately from the main browser thread
▸ Designed to be fully asynchronous
▸ Programmable network proxy
▸ Runs only over HTTPS
▸ Becomes idle when not in use and restarts when it's next needed.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ADVANCED FEATURES
▸ Notifications API - Display and interact with notifications using the operating
system's native notification system.
▸ Push API: Subscribe to a push service and receive push messages. Push
messages are delivered to a service worker, which can use the information in
the message to update the local state or display a notification to the user.
Because service workers run independently of the main app, they can receive
and display notifications even when the browser is not running.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ADVANCED FEATURES
▸ Background Sync API: Defer actions until the user has stable connectivity. This
is useful to ensure that whatever the user wants to send is actually sent. This API
also allows servers to push periodic updates to the app so the app can update
when it's next online.
▸ Channel Messaging API: Lets web workers and service workers communicate
with each other and with the host application.
SERVICE WORKER
LIFECYCLE
OFFLINE PROGRESSIVE WEB APPLICATIONS
1. REGISTRATION
▸ The scope of the service worker determines which files the service worker
controls. The default scope is the location of the service worker file, and extends
to all directories below. An arbitrary scope can also be set by passing in an
additional parameter when registering.
OFFLINE PROGRESSIVE WEB APPLICATIONS
2. INSTALLATION
▸ This occurs if the service worker is considered to be new by the browser.
▸ During the install, service workers can precache parts of a web app so that it
loads instantly the next time a user opens it.
OFFLINE PROGRESSIVE WEB APPLICATIONS
3. ACTIVATION
▸ If there are any open pages controlled by the previous service worker, the new service
worker enters a waiting state.
▸ The new service worker only activates when there are no longer any pages loaded
that are still using the old service worker. This ensures that only one version of the
service worker is running at any given time.
▸ When the new service worker activates, an activate event is triggered in the activating
service worker. This event listener is a good place to clean up outdated caches.
OFFLINE PROGRESSIVE WEB APPLICATIONS
OTHER EVENTS
▸ message - service worker can receive information from other scripts
▸ fetch - intercept requests.
▸ push - when a (Web Push Protocol) message is received.
▸ sync - ask for an event to be fired when the user has connectivity and we listen
for it
GOING OFFLINE
OFFLINE PROGRESSIVE WEB APPLICATIONS
CACHE API
▸ Lets us create stores of responses keyed by request.
▸ Exposed on the window so it accessed from anywhere in your scripts via "caches".
▸ waitUntil extends the lifetime of the
install event until the passed promise
resolves successfully. If the promise
rejects, the installation is considered
a failure and this service worker is
abandoned (if an older version is
running, it stays active).
OFFLINE PROGRESSIVE WEB APPLICATIONS
CACHE FALLING BACK TO THE NETWORK
▸ To serve content from the cache and make your app available offline you need
to intercept network requests and respond with files stored in the cache.
OFFLINE PROGRESSIVE WEB APPLICATIONS
ALL APPROACHES
▸ cache only
▸ network only
▸ cache falling back to network
▸ network falling back to cache
▸ cache then network
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVICE WORKERS
INSTALLABLE WEB APPS
OFFLINE PROGRESSIVE WEB APPLICATIONS
APPLICATION MANIFEST JSON
▸ Web app manifests provide the ability to save a site bookmark to a device's
home screen. When a site is launched this way:
▸ It has a unique icon and name so that users can distinguish it from other
sites.
▸ It displays something to the user while resources are downloaded or
restored from cache.
▸ It provides default display characterstics to the browser to avoid too abrupt
transition when site resources become available.
OFFLINE PROGRESSIVE WEB APPLICATIONS
SIMPLE MANIFEST JSON
IN PURSUIT OF SPEED
OFFLINE PROGRESSIVE WEB APPLICATIONS
HYPERTEXT TRANSFER PROTOCOL VERSION 2 (HTTP/2)
▸ Data compression of HTTP headers (HPACK)
▸ encode large headers using a fixed Huffman encoding
▸ encode commonly used headers as a variable length integer, rather than re-sending the whole header each
time
▸ HTTP/2 Server Push
▸ Multiplexing multiple requests over a single TCP connection
▸ Every request/response pair is mapped to a stream. Each stream is given a unique id.
▸ Priority - Allow a client to give priority preferences to particular streams
▸ Flow Control - Every stream, and the connection as a whole maintains a send window, which is the amount of
data that the server is allowed to send on the stream/connection.
OFFLINE PROGRESSIVE WEB APPLICATIONS
SERVER SIDE RENDERING
▸ First Meaningful Paint - The time at which the user feels that the primary
content of the page is visible.
▸ Rendering front-end JavaScript applications on the server.
TESTING
Introduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web Applications
QUESTIONS

More Related Content

PDF
Building and Scaling a WebSockets Pubsub System
PPTX
Progressive Web Apps
PDF
Progressive Web App (feat. React, Django)
PDF
Reactive Laravel - Laravel meetup Groningen
PDF
Sleep better by automating monitoring for your app (CakeFest 2013)
PPTX
API Proxy Auto Discovery
PDF
The Hitchhiker's Guide to Building a Progressive Web App
PDF
Bring Your Web App to the Next Level. Wprowadzenie do Progressive Web App
Building and Scaling a WebSockets Pubsub System
Progressive Web Apps
Progressive Web App (feat. React, Django)
Reactive Laravel - Laravel meetup Groningen
Sleep better by automating monitoring for your app (CakeFest 2013)
API Proxy Auto Discovery
The Hitchhiker's Guide to Building a Progressive Web App
Bring Your Web App to the Next Level. Wprowadzenie do Progressive Web App

What's hot (13)

PPTX
Web Performance Testing
PPTX
Real time Communication with Signalr (Android Client)
PPTX
Microsoft signal r
PPTX
Introduction to SignalR
PDF
Increasing Access Through Service Workers
PPTX
Load Testing Serverless Applications And Understanding How Lambda Scales
PDF
Meetup slide 1st june
PPTX
Laravel Events And Queue
PDF
Ways to measure & boost performance of your React app
PDF
Ways to measure & boost performance of your React app
PPTX
dotNetConf2019
PDF
Android HTTP Service
PPTX
SignalR with asp.net
Web Performance Testing
Real time Communication with Signalr (Android Client)
Microsoft signal r
Introduction to SignalR
Increasing Access Through Service Workers
Load Testing Serverless Applications And Understanding How Lambda Scales
Meetup slide 1st june
Laravel Events And Queue
Ways to measure & boost performance of your React app
Ways to measure & boost performance of your React app
dotNetConf2019
Android HTTP Service
SignalR with asp.net
Ad

Similar to Introduction to Offline Progressive Web Applications (20)

PDF
Offline progressive web apps with NodeJS and React
PDF
Angular Offline Progressive Web Apps With NodeJS
PDF
Progressive Web Apps
PPTX
Future of web development
PPTX
Progressive Web Applications - The Next Gen Web Technologies
PPTX
PWA basics for developers
PPTX
Pwa.pptx
PDF
pwa-170717082930.pdf
PPTX
Progressive web app
PPTX
PWAs overview
PPTX
Progressive Web Apps
PPTX
Centric - PWA WebCast
PDF
Progressive Web Apps / GDG DevFest - Season 2016
PDF
Progressive Web Apps –The Future of Apps
PPTX
Progressive Web Applications - A gentle introduction
PPTX
Why Progressive Web App is what you need for your Business
PDF
Progressive Web Applications
PDF
PERFORMANCE ENHANCEMENT OF WEBPAGE USING PROGRESSIVE WEB APP FEATURES
PDF
Progressive Web Apps
Offline progressive web apps with NodeJS and React
Angular Offline Progressive Web Apps With NodeJS
Progressive Web Apps
Future of web development
Progressive Web Applications - The Next Gen Web Technologies
PWA basics for developers
Pwa.pptx
pwa-170717082930.pdf
Progressive web app
PWAs overview
Progressive Web Apps
Centric - PWA WebCast
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps –The Future of Apps
Progressive Web Applications - A gentle introduction
Why Progressive Web App is what you need for your Business
Progressive Web Applications
PERFORMANCE ENHANCEMENT OF WEBPAGE USING PROGRESSIVE WEB APP FEATURES
Progressive Web Apps
Ad

More from Ilia Idakiev (17)

PDF
No more promises lets RxJS 2 Edit
PDF
Enterprise State Management with NGRX/platform
PDF
Deep Dive into Zone.JS
PDF
RxJS Schedulers - Controlling Time
PDF
Creating lightweight JS Apps w/ Web Components and lit-html
PDF
No More Promises! Let's RxJS!
PDF
Marble Testing RxJS streams
PDF
Deterministic JavaScript Applications
PDF
Web Components Everywhere
PDF
Building Reusable Custom Elements With Angular
PDF
State management for enterprise angular applications
PDF
Testing rx js using marbles within angular
PDF
Predictable reactive state management for enterprise apps using NGRX/platform
PDF
Angular server side rendering with NodeJS - In Pursuit Of Speed
PDF
Reflective injection using TypeScript
PDF
Zone.js
PDF
Predictable reactive state management - ngrx
No more promises lets RxJS 2 Edit
Enterprise State Management with NGRX/platform
Deep Dive into Zone.JS
RxJS Schedulers - Controlling Time
Creating lightweight JS Apps w/ Web Components and lit-html
No More Promises! Let's RxJS!
Marble Testing RxJS streams
Deterministic JavaScript Applications
Web Components Everywhere
Building Reusable Custom Elements With Angular
State management for enterprise angular applications
Testing rx js using marbles within angular
Predictable reactive state management for enterprise apps using NGRX/platform
Angular server side rendering with NodeJS - In Pursuit Of Speed
Reflective injection using TypeScript
Zone.js
Predictable reactive state management - ngrx

Recently uploaded (20)

PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
ai tools demonstartion for schools and inter college
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
AI in Product Development-omnex systems
PDF
Nekopoi APK 2025 free lastest update
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
How Creative Agencies Leverage Project Management Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Odoo POS Development Services by CandidRoot Solutions
ai tools demonstartion for schools and inter college
CHAPTER 2 - PM Management and IT Context
How to Choose the Right IT Partner for Your Business in Malaysia
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms I-SECS-1021-03
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
Design an Analysis of Algorithms II-SECS-1021-03
2025 Textile ERP Trends: SAP, Odoo & Oracle
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
AI in Product Development-omnex systems
Nekopoi APK 2025 free lastest update
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Upgrade and Innovation Strategies for SAP ERP Customers

Introduction to Offline Progressive Web Applications

  • 2. WHY PWA? FAST - Respond quickly to user interactions with silky smooth animations and no janky scrolling. RELIABLE - Load instantly and never show the downasaur, even in uncertain network conditions. ENGAGING - Feel like a natural app on the device, with an immersive user experience.
  • 3. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVICE WORKERS ▸ Runs separately from the main browser thread ▸ Designed to be fully asynchronous ▸ Programmable network proxy ▸ Runs only over HTTPS ▸ Becomes idle when not in use and restarts when it's next needed.
  • 4. OFFLINE PROGRESSIVE WEB APPLICATIONS ADVANCED FEATURES ▸ Notifications API - Display and interact with notifications using the operating system's native notification system. ▸ Push API: Subscribe to a push service and receive push messages. Push messages are delivered to a service worker, which can use the information in the message to update the local state or display a notification to the user. Because service workers run independently of the main app, they can receive and display notifications even when the browser is not running.
  • 5. OFFLINE PROGRESSIVE WEB APPLICATIONS ADVANCED FEATURES ▸ Background Sync API: Defer actions until the user has stable connectivity. This is useful to ensure that whatever the user wants to send is actually sent. This API also allows servers to push periodic updates to the app so the app can update when it's next online. ▸ Channel Messaging API: Lets web workers and service workers communicate with each other and with the host application.
  • 7. OFFLINE PROGRESSIVE WEB APPLICATIONS 1. REGISTRATION ▸ The scope of the service worker determines which files the service worker controls. The default scope is the location of the service worker file, and extends to all directories below. An arbitrary scope can also be set by passing in an additional parameter when registering.
  • 8. OFFLINE PROGRESSIVE WEB APPLICATIONS 2. INSTALLATION ▸ This occurs if the service worker is considered to be new by the browser. ▸ During the install, service workers can precache parts of a web app so that it loads instantly the next time a user opens it.
  • 9. OFFLINE PROGRESSIVE WEB APPLICATIONS 3. ACTIVATION ▸ If there are any open pages controlled by the previous service worker, the new service worker enters a waiting state. ▸ The new service worker only activates when there are no longer any pages loaded that are still using the old service worker. This ensures that only one version of the service worker is running at any given time. ▸ When the new service worker activates, an activate event is triggered in the activating service worker. This event listener is a good place to clean up outdated caches.
  • 10. OFFLINE PROGRESSIVE WEB APPLICATIONS OTHER EVENTS ▸ message - service worker can receive information from other scripts ▸ fetch - intercept requests. ▸ push - when a (Web Push Protocol) message is received. ▸ sync - ask for an event to be fired when the user has connectivity and we listen for it
  • 12. OFFLINE PROGRESSIVE WEB APPLICATIONS CACHE API ▸ Lets us create stores of responses keyed by request. ▸ Exposed on the window so it accessed from anywhere in your scripts via "caches". ▸ waitUntil extends the lifetime of the install event until the passed promise resolves successfully. If the promise rejects, the installation is considered a failure and this service worker is abandoned (if an older version is running, it stays active).
  • 13. OFFLINE PROGRESSIVE WEB APPLICATIONS CACHE FALLING BACK TO THE NETWORK ▸ To serve content from the cache and make your app available offline you need to intercept network requests and respond with files stored in the cache.
  • 14. OFFLINE PROGRESSIVE WEB APPLICATIONS ALL APPROACHES ▸ cache only ▸ network only ▸ cache falling back to network ▸ network falling back to cache ▸ cache then network
  • 15. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVICE WORKERS
  • 17. OFFLINE PROGRESSIVE WEB APPLICATIONS APPLICATION MANIFEST JSON ▸ Web app manifests provide the ability to save a site bookmark to a device's home screen. When a site is launched this way: ▸ It has a unique icon and name so that users can distinguish it from other sites. ▸ It displays something to the user while resources are downloaded or restored from cache. ▸ It provides default display characterstics to the browser to avoid too abrupt transition when site resources become available.
  • 18. OFFLINE PROGRESSIVE WEB APPLICATIONS SIMPLE MANIFEST JSON
  • 19. IN PURSUIT OF SPEED
  • 20. OFFLINE PROGRESSIVE WEB APPLICATIONS HYPERTEXT TRANSFER PROTOCOL VERSION 2 (HTTP/2) ▸ Data compression of HTTP headers (HPACK) ▸ encode large headers using a fixed Huffman encoding ▸ encode commonly used headers as a variable length integer, rather than re-sending the whole header each time ▸ HTTP/2 Server Push ▸ Multiplexing multiple requests over a single TCP connection ▸ Every request/response pair is mapped to a stream. Each stream is given a unique id. ▸ Priority - Allow a client to give priority preferences to particular streams ▸ Flow Control - Every stream, and the connection as a whole maintains a send window, which is the amount of data that the server is allowed to send on the stream/connection.
  • 21. OFFLINE PROGRESSIVE WEB APPLICATIONS SERVER SIDE RENDERING ▸ First Meaningful Paint - The time at which the user feels that the primary content of the page is visible. ▸ Rendering front-end JavaScript applications on the server.