
Learn to build angular progressive web apps with the angular service worker, covering background download and installation, version management, updates, caching strategies, app shell, manifest, notifications, and offline capabilities.
Set up the Angular PWA environment by installing Node and npm, selecting an editor, downloading code, and starting the rest server on port 9000 for 4200 app with service workers.
Explore running an Angular PWA in production mode, serving the dist output with a lightweight http server, and verify service worker caching, offline availability, and API request proxying.
The service worker acts as a network interception proxy, serving assets from cache storage or IndexedDB and improving startup speed and offline performance.
Discover how the Angular service worker handles application version management by detecting new builds, downloading updated bundles in the background, and prompting users to load the new version.
The Angular service worker kill switch lets you disable client-side caching to force network requests, switch to a new version, and restore normal web app behavior.
Configure a cache-first, network-last policy for the lessons API in Angular service worker, caching data for one day with a max size of 100 to enable offline access.
Explore the freshness caching policy in the Angular service worker, using network-first with a 10-second timeout and fallback to cache for data, including latency simulation and versioned updates.
Learn how to add a manifest.json to make a progressive web app installable with a home screen icon, start url, orientation, and background color; test in production with service workers.
Explore the application shell concept to solve first paint delays in single-page apps by delivering more initial HTML and a loading skeleton, improving time to first meaningful render.
Learn to add an app shell with Angular Universal, pre-render content, and inject HTML into index.html at build time using the Angular CLI.
Learn to add and render an app shell with Angular router and Angular Universal, pre-render the app shell route, and wire server routing to the app shell component for performance.
Generate the app shell with the app shell component to reveal output and measure performance benefits, including a visible loading indicator and faster time to first meaningful paint.
Kick off the push notifications section by switching to the one-dash-notifications branch, installing dependencies, starting the local server, and implementing subscribe and send for native-like alerts.
Learn to implement push notification subscriptions in an angular pwa, generate vapid keys with the web-push library, and configure server identification for reliable browser notifications.
Learn the differences between the vapid public and private keys: the public key identifies the server and requests permission, while the private key dispatches notifications from the server.
Learn how web push works by obtaining the browser's push subscription object, including endpoint and vapid key. Send the subscription to your server to trigger notifications via browser push service.
Send the subscription object from the client to the server via http post to /api/notifications. Log the subscription on the server and store it in memory for future push notifications.
Learn how to re-display the push notifications permission prompt by clearing the app's notification settings in Chrome, then tapping subscribe to show the allow or deny popup again.
Configure the server with vapid keys and the web-push library to dispatch Firebase Cloud Messaging notifications, then build a payload and send to subscriptions.
Learn to implement and test web push notifications in an Angular PWA, including subscribe flow, service worker handling, push and notifications APIs, and app manifest installation features.
Explore service worker fundamentals and registration by building simple workers similar to the Angular service worker, and test offline pages, downloads, and installation with Chrome DevTools.
Write and log your first service worker and use chrome dev tools to inspect the service worker lifecycle. See how activation, deactivation, and versioning behave across tabs.
Explore the service worker lifecycle, focusing on install and activate phases, and understand application versioning by deploying and activating version two to deliver consistent offline-ready experiences.
Download and cache the offline page during service worker installation, blocking installation until fetch succeeds, and enable offline content via cache storage and the browser cache API.
Learn to use the browser cache API to open a named cache, cache the offline page with put, and serve it when network requests fail in a service worker.
Learners implement http interception with a service worker to serve a cached offline.html page when the network fails. They explore the fetch event, event.respondWith, and serving offline content on error.
Use service workers to intercept http requests and serve an offline page from cache when the network fails. Refactor for exact response handling and add offline versioning.
Learn to download and install a web app version in the browser, manage multiple versions and upgrades using the service workers and the cache API.
Download and install app files in the background with service workers and cache storage to enable offline use and faster startup, using versioned caches and addAll.
Implement a cache-then-network strategy with a service worker to serve http requests from cache, fetch from network when unavailable, and support offline installation and version updates.
Enhance offline capability by caching lessons data and manage service worker versions to deploy builds, activating when old instances terminate, and caching rest calls such as api/lessons alongside static assets.
Implement the service worker activation to purge older app caches, keep only the current version (13), and improve startup time by background upgrades without interrupting the user.
Demonstrate how a service worker improves performance on slow connections by serving cached app assets, comparing with no service worker, and highlighting lifecycle customization.
Learn how the default service worker lifecycle downloads and caches the app, manages version upgrades, and ensures consistency by only activating after all tabs use the same version.
Learn how to enable early activation of the service worker with clients.claim(), so new versions apply immediately while noting tradeoffs in page versus service worker consistency.
Explore how skipWaiting and immediate activation affect the service worker lifecycle, activation, and page claims. Learn the risks of version mismatch and timing when upgrading service workers.
Learn how browsers prevent a buggy service worker from breaking your site by automatically comparing versions and updating through registration.update, with manual checks and careful caching to minimize downtime.
Learn how the Angular service worker enhances apps with background download, installation, version management, and notifications. Understand service workers' lifecycle and caching strategies that benefit any application with faster start.
This Course In a Nutshell - Part 1 Angular Service Worker (includes the Typescript Jumpstart Ebook)
In the first part of the course we are going to dive straight into the Angular Service Worker and the built-in Angular CLI PWA support. We are going to take as the starting point a plain Angular Application, and we are going to start adding PWA features on top of it in order to turn it into a Progressive Web Application.
We will start by adding the Angular Service Worker and have the Application Download & Installation feature up and running. We will learn all about Application Version Management and we will learn about the multiple caching strategies available for caching not only the application bundles, but also the application data.
We will then add an Application Shell using the Angular CLI and Angular Universal, and make the application One-Click Installable using an App Manifest. Finally we will add Push Notifications to the application using the Angular Service Worker, for a complete mobile-like PWA experience.
This Course In a Nutshell - Part 2 - Service Workers Fundamentals
In this second part, you will learn about Progressive Web Applications in general (including Service Workers, App Manifest, and the Cache Storage API.), and you will use these APIs to implement several native-like features: One-Click Install, Offline support, application download and installation, application data caching and more.
We will also learn Service Worker Web Fundamentals from first principles using built-in browser APIs directly and we will confirm our understanding of what is going on in every step of the way using the PWA built-in Chrome Dev Tools.
The knowledge learned on this section has a long shelf live, as its about browser fundamentals and how the new PWA Web works in general, so everything learned here is still applicable to any other development platform other than Angular.
Why PWAs? Build the Future Of the Web Today
The future of the Web is clearly going in one direction: Progressive Web Applications! With the upcoming Safari support and the ability to install a PWA directly to a Windows desktop, PWAs are the new generation of web applications that will bridge the gap towards Native Apps: this will even include in the near future things like Bluetooth and Payments.
PWAs look and feel like native apps, but there is no App Store and all its issues involved: instead a web application can now be installed directly to the user desktop or home screen with one single click!
The application will then install itself immediately on the background, so that it does not have to be downloaded again unless a new version is available.
The application will feel blazing fast in a way that until now only native apps could: A PWA is offline, background sync and notification capable.
PWAs are not mobile-specific: any application can benefit from starting up an order of magnitude faster! The Angular CLI PWA support and the Angular Service Worker take PWA features to another level: we will be able to add PWA features reliably to our application in a transparent way via the Angular CLI, as part of the production build process.
But we will still need to understand how PWA features work under the hood, in order to troubleshoot any issues, interact with the Angular Service Worker or configure the Angular CLI.
Course Overview
In part 1, we are going to take PWA features one at a time.These features where designed to be used together, so using them to implement a concrete use case is the best way to learn them. The main component of a PWA is a Service Worker, so that is our starting point.
We are going to learn all about the Service Worker lifecycle, how multiple versions of the service worker are handled by the browser, and we will learn multiple Service worker installation and activation GOTCHAs. We are then going to build a service worker that gives to an application the ability of showing an offline page when the network is down, using the Cache API.
Most of the PWA APIs are Promise-based, so to make the code more readable we are going to be using Async / Await in our examples. We are then going to implement Application Download and Installation: we are going to see how we can use a Service Worker to completely download a version of the website into a user's mobile or desktop, and how to handle the installation of multiple versions of the application.
We are going to demo the performance benefits of caching the complete application locally by simulating a slow network, and learn how to clean previous versions of an application. We will also learn how to cache UI-specific data and derived View Model data on the client side using Indexed DB and a Service Worker, and we will also earn how to implement Background Sync.
The next section of the course will cover all about the App Manifest and how to configure that one-click installation experience that we are looking for. After that, we will inspect our application with the Lighthouse tool and analyze the generated report.
The last part of this PWA fundamentals section will cover Web Push and Notifications. In this section, we are going to setup a node server with Web Push capabilities, and then we are going to link it to our service worker in order to implement mobile-like Notifications.
What Will you Learn In this Course?
You will learn how the PWA Browser features work in general, not only in the context of an Angular application. You will know how to analyze and troubleshoot PWAs using the Chrome PWA Dev Tools. You will also learn how to leverage the Angular Service Worker, and all the Angular CLI PWA features to build PWA-enabled web applications.
What Will You be able to do at the End Of This Course?
You will be able to design, develop and troubleshoot PWAs, plus you will know how to quickly add PWA features to an Angular Application leveraging the Angular CLI and the Angular Service Worker.
Have a look at the course free lessons below, and please enjoy the course!