I’m working on a system where a survey is embedded into third-party customer websites. We embed the survey as HTML .The survey is triggered based on user interactions such as clicks or scroll events. Currently, the loading time is around 4-5 seconds, which is longer than the desired 1-2 seconds. One of the key factors causing the delay is that we need to make 2-3 API calls to perform server-side validations before rendering the survey. Despite keeping the bundle size small, these API calls are necessary for the functionality and are leading to the slower load time.
I’ve taken several steps to reduce the load time, including:
- Minimizing the JavaScript bundle size
- Implementing lazy loading for certain assets
- Optimizing client-side rendering
However, these changes haven’t been enough to meet the desired performance. The expectation is for the survey to load within 1-2 seconds, but I am still seeing 4-5 seconds due to the API call delays. I’m looking for strategies to reduce the loading time without compromising the server-side validations.