This chapter covers:
- Examining server-side composition using Nginx and SSI.
- Investigating how timeouts and fallbacks can help when dealing with broken or slow fragments.
- Comparing the performance characteristics of different composition techniques.
- Exploring alternative solutions like Tailor, Podium, and ESI.
In the previous chapters, you learned how to build a micro frontends style site using client-side integration techniques like links, iframes, and AJAX. You’ve also learned how to run a shared web-server that routes incoming requests to the responsible team for a specific part of the application. In this chapter, we will build upon these and look at server-side integrations. Assembling the markup of different fragments on the server is a widespread and popular solution. Many e-commerce companies like Amazon, IKEA, or Zalando have chosen this way.
Server-side composition is typically done by a service that sits between the browser and the actual application servers, as illustrated in figure 4.1.
Figure 4.1. Composition of fragments happens on the server. The client receives an already assembled page.
The most significant benefit if server-side integration is that the page is already fully assembled when it reaches the customer’s browser. You can achieve incredibly good first-page load speeds that are hard to match using pure client-side integration techniques.