Salesforce Platform Developer I (legacy) — Question 167

A developer wants to improve runtime performance of Apex calls by caching results on the client.

What is the most efficient way to implement this and follow best practices?

Answer options

Correct answer: D

Explanation

The correct answer is D because using @AuraEnabled(cacheable=true) allows the results of the server-side method to be cached on the client efficiently, improving performance and following best practices. Options A and C are incorrect as they do not utilize the appropriate caching method for Apex calls, and option B is less efficient compared to the built-in caching provided by Salesforce.