Next.js · Senior · Question 26 of 75

How do GET Route Handlers behave with Cache Components enabled?

Explanation

If the handler doesn't read request data, its response can be prerendered at build time; use 'use cache' for cacheable parts. Accessing request, cookies() or headers() makes the response dynamic. Methods other than GET are always dynamic.

Further reading

Problem with a question

Next.js · Senior · question 26

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