Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Server-Side Enterprise Development with Angular

You're reading from   Server-Side Enterprise Development with Angular Use Angular Universal to pre-render your web pages, improving SEO and application UX

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher
ISBN-13 9781789806267
Length 142 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Bram Borggreve Bram Borggreve
Author Profile Icon Bram Borggreve
Bram Borggreve
Arrow right icon
View More author details
Toc

Configuring the Service Worker

In the previous section, we added the service worker configuration file, src/ngsw-config.json, to our project, but we have not configured anything yet.

In this section, we will add two types of configuration, asset groups and data groups. We will use a fairly straightforward configuration for our service worker. Please refer to the service worker configuration page for a detailed description of the configuration options in ngsw-config.json.

Exercise 47: Configuring Asset Groups

In this exercise, we will append two items to the asset groups configuration. In the asset groups configuration, we will specify how we want our service worker to handle the assets of the application.

When we talk about assets, we think of stylesheets, images, and external JS files. The first asset group caches the data that comes from the domains that we use to fetch our CSS and the fonts included in that CSS. The second asset group caches the static data from the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image