Thanks @jagadeesh_prakash @sady_rifat @arunpatidar for the suggestions and perspectives.
On further analysis, I could break down the areas into following parts:
- Node and npm install: This should be cached as suggested by you as well. In our case, caching is already in place.
- Webpack execution: For customers that have been on AEM for long, might be using older version of various node modules. The latest might have improvements on the same, might have better performance. Explanation available on: https://dev.to/slashgear_/how-to-boost-the-speed-of-your-webpack-build-16h0.
- Executing ui.frontend only when needed: Maven profile helped here. We just add an additional profile to build ui.frontend (helpful for local deployments).