Book Image

Beginning Server-Side Application Development with Angular

By : Bram Borggreve
Book Image

Beginning Server-Side Application Development with Angular

By: Bram Borggreve

Overview of this book

Equip yourself with the skills required to create modern, progressive web applications that load quickly and efficiently. This fast-paced guide to server-side Angular leads you through an example application that uses Angular Universal to render application pages on the server, rather than the client. You'll learn how to serve your users views that load instantly, while reaping all the SEO benefits of improved page indexing. With differences of just 200 milliseconds in performance having a measurable impact on your users, it's more important than ever to get server-side right.
Table of Contents (10 chapters)

Debugging the Service Worker


There is a famous saying in computer science:

"There are 2 hard problems in computer science: cache invalidation, naming things."

-Phil Karlton

The first one applies to debugging service workers.

As discussed earlier, a service worker adds a caching layer between the network and the device. This inherently makes it hard to debug, because when you update your service worker definition or the configuration of your website, your changes might very well be cached, and thus not visible.

It is a quite well-known challenge while developing applications with service worker support, so it's good to understand how to debug the service worker.

Chrome Developer Tools to the Rescue

Chrome Developer Tools is an advanced tool for inspecting and debugging the technology behind websites, and luckily, it has great support for service workers.

In the Application tab, we can see which service workers are installed, what their status is, and unregister them to make sure we download the latest...