Data retrieval
- There should not be other option to obtain the data while making a call to the server.
- Don’t fetch same data in different components,consider passing data between components using attributes, events or methods)
- LDS is also an option to share data.
- When making a call to the server, limit the columns and rows of the result set.
- Don’t preload data that the user may not needed.
- Data filtering and sorting logic should be on the client side.
- Combine multiple requests in a single composite request.
- Cached data when possible.
Data caching
- If all the components you build make their own isolated calls to the server to retrieve the data they need, you’ll probably end up with lots of redundant server calls, which can dramatically impact performance.
- Client-side data caching can solve that problem by sharing data among components.
- This can significantly reduce the number of server round-trips, and improve the performance of your Lightning components.
- The Lightning Component Framework has two built-in mechanisms for client-side caching (storable actions and Lightning Data Service).
- You can also implement a custom caching solution.

Conditional rendering
- Toggling visibility using CSS
- Conditionally creating elements using
- Note:Components inside an with the value of its isTrue expression evaluating to false aren’t created and aren’t part of the DOM.
Data Binding
- Proper use of Bound and Unbound expressions.
- When using , don’t support the creation of an infinite number of list items.Either provide a pagination or reuse the list.
- Limit the use of Application events.
- Use Component Events for child to parent communication.
- Remove dependencies on unneeded libraries that could change the DOM elements.
- Use minified versions of libraries and style sheets
- Use Base Lightning components
- Use the Lightning Design System icons instead of custom icons.
- Lock image dimensions and serve the image in those dimensions, don’t load a high-resolution image to display a thumbnail.
Use Recommended Settings for getting the output after changes otherwise you need to refresh your component to reflect the changes.

- Client-side caching and debugging are org-wide settings.
- Disabling client-side caching and enabling debugging has a significant impact on performance.
- Only do this in your development environment, not in a production environment.
- Similarly, if you run tests to assess the performance of your environment, remember to turn these settings back to the production values.
Content and Image Source: developer.salesforce.com
Leave a comment