Next.js · Senior · Question 11 of 75

Why does a CSP with a nonce make pages dynamic?

Explanation

Next.js reads the nonce from a request header (generated by proxy) and adds it to its scripts. Static HTML with a fixed nonce makes no sense. An alternative that keeps static rendering is a hash-based CSP or looser policies.

Further reading

Problem with a question

Next.js · Senior · question 11

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