Repository navigation
Conversation
timkelty
added a commit
that referenced
this pull request
Nov 17, 2026
[ci skip] Amp-Thread-ID: https://ampcode.com/threads/T-98c43de3-5928-4808-87b0-9ea9a912bb6b Co-authored-by: Amp <amp@ampcode.com>
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
CDNs read CDN-Cache-Control, Cloudflare-CDN-Cache-Control, and Surrogate-Control in place of Cache-Control, so a queued one could keep a response cacheable at the edge after Craft sent no-cache headers. ResponseHeaders::setNoCacheHeaders() now removes them, and every place that sends no-cache headers uses it. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-98c43de3-5928-4808-87b0-9ea9a912bb6b
…-cdn-headers Amp-Thread-ID: https://ampcode.com/threads/T-98c43de3-5928-4808-87b0-9ea9a912bb6b Co-authored-by: Amp <amp@ampcode.com> # Conflicts: # CHANGELOG.md
timkelty
force-pushed
the
timkelty/no-cache-cdn-headers
branch
from
November 17, 2026 14:27
1ee2712 to
47cf100
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CDNs read targeted cache headers in place of
Cache-Control:CDN-Cache-Control(RFC 9213), Cloudflare'sCloudflare-CDN-Cache-Control, and Fastly'sSurrogate-Control. When Craft sends no-cache headers, it only replacesCache-Control,Pragma, andExpires. So a page that queued{% header "CDN-Cache-Control: max-age=3600" %}and then printed a CSRF token, or a control panel, action, or token response with such a header, went out asno-storeto browsers but stayed cacheable at the edge.ResponseHeaders::setNoCacheHeaders()now sets the no-cache headers and removes those three.SetHeaders,HandleTokenRequest,StartLazySession,ResponseHeaders::noCache(), and thesetNoCacheHeaders()response macro all use it, so every no-cache path behaves the same.Stacked on #20753.
Related issues