Next.js · Senior · Question 41 of 75

What does after() in a Route Handler give you compared to await logEvent() before responding?

Explanation

The user doesn't have to wait for analytics, logs or syncing with third-party services. The platform keeps the function alive until the after callbacks finish. Inside, you can read cookies() and headers() in Server Actions and Route Handlers.

Further reading

Problem with a question

Next.js · Senior · question 41

Test yourself

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

Take this quiz