-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The Art of Micro Frontends
By :

To cover the advantages and disadvantages of this pattern, we need to look at its close companion: server-side composition. If done correctly, then edge-side composition will be much more lightweight and allow us to do things such as caching. This gives websites a great performance boost, without us requiring more sophisticated algorithms or tricks.
One of the reasons why even a non-cached response may be faster with edge-side composition is that fragments are supposed to be flat. In the previous pattern, we were not only able to utilize nested fragments, but were actually encouraged to do exactly that. But even a non-flat structure can be flattened by using a simple trick. We'll illustrate this by using code.
Let's say we start with a structure like this:
// index.html (original) <esi:include src="http://example.com/fragment1.html" /> // fragment1.html <esi:include src="http://example.com/fragment2.html"...