aem-project-archetype
aem-project-archetype copied to clipboard
ui.frontend clientlib generation potential performance optimization
Expected Behaviour
The webpack build outputs 3 chunks: runtime, vendor, main. These 3 files should be loaded onto pages seperately in order to leverage browser caching in the most optimal manner.
Actual Behaviour
The clientlibs generator will create a single clientlib (clientlib-react) containing all 3 of these files. Bundling them together and creating its hash based on the content of all 3.
These means that whenever we make a change the "main" bundle, the hash of the clientlib changes causing browser cache to be busted.
If we had 3 clientlibs, each bundle would have its own independent cache and hash value.
![Screenshot 2023-02-08 at 15 24 42](https://user-images.githubusercontent.com/2510520/217575211-89af648e-182b-41d9-a2b4-9b955e9aa0c1.png)
Reproduce Scenario (including but not limited to)
Steps to Reproduce
- Build the sample produced by the archetype using a react frontend
- Observe the js.txt definition of clientlibs-react
Platform and Version
All