問題文
A bank's account page is built from 14 small Lightning web components. Each one was kept deliberately tiny and each retrieves its own slice of the same customer record from a different Apex method. Page load is slow and support tickets mention intermittent failures under load. How should the developer reconsider the design?
選択肢
- Keep all 14 retrievals but change each Apex method so that it is annotated as cacheable, which removes the per-invocation limits and lets all 14 of the calls share a single budget for the whole page load in the browser.
- Have one parent component retrieve the customer data and pass the pieces down through public properties, because Apex limits are counted for each method invocation and many separate calls also queue many actions.
- Keep the 14 components and have each one query the record again inside its rendering hook, so that every component always shows the freshest values and the page never displays data that another component has already changed.
- Merge all 14 components into a single component so that the page contains only one component and therefore makes just one call to the server for the whole customer record each time.