Salesforce Certified Platform Developer II — Question 105
A Visualforce page loads slowly due to the large amount of data it displays.
Which strategy can a developer use to improve the performance?
Answer options
- A. Use Javascript to move data processing to the browser instead of the controller.
- B. Use the transient keywords for the List variables used in the custom controller.
- C. Use lazy loading to load the data on demand, instead of the controller's constructor.
- D. Use an <apex:actionPoller> in the page to load all of the data asynchronously.
Correct answer: C
Explanation
The correct answer is C because lazy loading allows data to be fetched only when necessary, improving load times and performance. Option A may reduce server load, but it doesn't address the initial page load issue. Option B only affects the lifespan of variables during a request and doesn't impact performance significantly, while option D would still attempt to load all data, which doesn't solve the slow loading problem.