Nonce caching/generation on edge proxies or CDNs

Open
#44,021 18 comments 3 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@hamishwillee is already working on this.

Since May 7, 2026.

Assessment

This issue has not been assessed yet.

Description

Content:HTTP help wanted
MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP

What specific section or headline is this issue about?

Nonce caching

What information was incorrect, unhelpful, or incomplete?

Hi there 👋 , it's the Django community again :)

CSP 3 states that the nonce MUST be random on each transmission.

This is reflected in the docs here: https://github.com/mdn/content/blob/3b8fdeeaa5b96796870166b989de523261e5fc05/files/en-us/web/http/guides/csp/index.md?plain=1#L184

However, in relation to RFC 7234 caches, this would mean that proxies MUST not cache pages if a nonce-source expression is present in the policy.

What did you expect to see?

I'd love to see some clarification on how applications should or rather SHOULDN'T handle this.

The discussion was sparked as part of https://github.com/django/django/pull/21010#pullrequestreview-4235130467 and whether Django should set an additional explicit Cache-Control header.

My understanding of CSP is that this is NOT needed, as the standard is pretty clear on what a nonce needs to be.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

I don't believe this affects the security of browsers like FF, since client caching nonces is safe anyway. As nonce generation is limited to transmissions.

MDN metadata
Page report details
Dominant language
Markdown
Stars
11.2k
Forks
23.3k
Avg merge
2d 6h
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mdn/content

All issues in mdn/content

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.