Svelte · Middle · Question 55 of 75

What is the purpose of +page.server.js returning a promise for slow data?

export async function load() {
  return {
    post: await getPost(),
    comments: getComments(), // not awaited
  };
}

Explanation

Streaming improves time to first content. On platforms without streaming support, the response waits for everything.

Further reading

Problem with a question

Svelte · Middle · question 55

Test yourself

Take the Svelte · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz