You need to sign in to do that
Don't have an account?
Madhusudan Singh 19
Caching Apex response in lightning aura components
Hi All,
What should I use for caching Apex results in client side. @AuraEnabled(cacheble=true) in apex class or. setStorable in client side?
Regards
Madhusudan Singh
What should I use for caching Apex results in client side. @AuraEnabled(cacheble=true) in apex class or. setStorable in client side?
Regards
Madhusudan Singh
For API version of 44.0 or higher, you can mark the Apex method as storable (cacheable) and get rid of any setStorable() calls in JavaScript code. The Apex annotation approach is better because it centralizes your caching notation for a method in the Apex class.
so you can use @AuraEnabled(cacheble=true).
In Lightning terminology, a server action is an Apex method that you invoke remotely from your Lightning Component. A storable action is a server action whose response is stored in the client cache so that subsequent requests for the same server method with the same set of arguments can be accessed from that cache.
If this solution is usefull for you, Please mark as a Best Answer to help others.
Regards
Mukesh