27 Optimizing application delivery

 

This chapter covers

  • Reducing the size of the application using dynamically loaded modules
  • Using server-side rendering to create an HTML representation of the application
  • Using rehydration to transition from server-rendered HTML to browser-generated content
  • Prerendering the application to create a static HTML representation of the application

Complex Angular applications can require large JavaScript files, which can take a long time to download over a slow network connection. In this chapter, I describe the features Angular provides for optimizing application delivery to minimize the amount of time before the user can interact with the application.

27.1 Preparing the example project

27.2 Understanding the delivery problem

27.3 Loading feature modules dynamically

27.3.1 Creating a simple feature module

27.3.2 Loading the module dynamically

27.3.3 Guarding dynamic modules

27.4 Using server-side rendering

27.4.1 Installing the server-side rendering packages

27.4.2 Preparing the application

27.4.3 Building and running the SSR application

27.4.4 Enabling navigation

27.4.5 Modifying the terms guard

27.4.6 Dealing with direct navigation

27.4.7 Testing rehydration

27.5 Using prerendering

27.5.1 Preparing the application

27.5.2 Prerendering the application

27.6 Summary