All About Salesforce Related Queries

Joined March 2021
1 Photos and videos
What is the use of cachable=true on Apex method? The "@wire" decorator in Lightning Web Components (LWC) is used to read data from Salesforce servers. When you set the "cacheable" attribute to "true", Salesforce caches the response from your Apex method.
1
71
The response from this request is stored in the client cache, and it's used for all components that made this call.
1
20
In the above example, if multiple instances of the "AccountDetails" component are present on a single page, and they all provide the same "accountId", Salesforce only makes a single server call to get the account details. The response is then cached and used for all the
19