Repository navigation
Conversation
This was referenced Nov 10, 2026
timkelty
added a commit
that referenced
this pull request
Nov 10, 2026
Tag pages with their Craft cache tags and derive CDN-Cache-Control from the final response headers. Purge on every TagDependency invalidation, except drafts and revisions, with one queued PurgeStaticCache job per request, command or queue job, signed with #213's RequestSigner. Add a Clear Caches option and a single cloud:purge command. Require craftcms/cms ^6.0.0-beta.1. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-6551416a-ce7c-4e90-adac-8c2edc72248c
timkelty
added a commit
that referenced
this pull request
Nov 10, 2026
Tag pages with their Craft cache tags and derive CDN-Cache-Control from the final response headers. Purge on every TagDependency invalidation, except drafts and revisions, with one queued PurgeStaticCache job per request, command or queue job, signed with #213's RequestSigner. Add a Clear Caches option and a single cloud:purge command. Require craftcms/cms ^6.0.0-beta.1. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-6551416a-ce7c-4e90-adac-8c2edc72248c
timkelty
added a commit
that referenced
this pull request
Nov 10, 2026
Tag pages with their Craft cache tags and derive CDN-Cache-Control from the final response headers. Purge on every TagDependency invalidation, except drafts and revisions, with one queued PurgeStaticCache job per request, command or queue job, signed with #213's RequestSigner. Add a Clear Caches option and a single cloud:purge command. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-6551416a-ce7c-4e90-adac-8c2edc72248c
timkelty
force-pushed
the
feature/craft-6-cloud-transforms
branch
2 times, most recently
from
December 5, 2026 16:10
3692144 to
fbdc571
Compare
Only when the project hasn't chosen one, and without replacing a craft-cloud transformer the project defined. Volumes without public URLs, such as temporary uploads, now go to the craft transformer, since the default reaches them too. Amp-Thread-ID: https://ampcode.com/threads/T-01a1b2a5-ffcf-7312-966f-7e8624cf8b79
timkelty
force-pushed
the
feature/craft-6-cloud-transforms
branch
from
December 6, 2026 01:15
b48a616 to
b9446ba
Compare
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.
Summary
This adds a
craft-cloudasset transform driver. Transforms become signed Cloudflare image URLs on the Cloud CDN, and the gateway verifies the signature before it transforms anything.On Craft Cloud, the provider sets the driver up for every volume:
craft-cloudtransformer, unless the project already defines one.defaultTransformertocraft-cloud, unless the project already set one.Off Cloud, nothing changes unless a project opts in itself:
Parameter mapping
Behavior
Cloudflare-only options. The driver declares these as
parameterRules, so core validates them:anim,background,blur,border,brightness,compression,contrast,dpr,draw,flip,gamma,gravity,metadata,rotate,saturation,segment,sharpen,trimandzoompageYou can set them inline, or on named transforms under the transformer's name. They have no CP fields for beta.
Which assets. The driver transforms every public asset on S3 in the volumes that use it1.
images.transformGifsandimages.transformSvgs.crafttransformer. Core's docs recommend this handoff for a default transformer.Results. Each result reports its output width and height, calculated the way the
craftdriver does it, sogetImg()andxsrcsets work.Signing.
CraftCms\Cloud\Signing\RequestSigneris shared with Add static page caching for Craft 6 on Cloud #214.Dependencies
craftcms/http-message-signatures,guzzlehttp/guzzle,league/uriandleague/uri-components.craftcms/cms ^6.0.0-beta.3comes from Rebuild the 5.x baseline for Craft 6 beta #215.composer.lock, so whichever PR merges second needscomposer update --lock.Proposed gateway change
If the gateway rasterized PDFs without a requested format, as it already does for images, the driver wouldn't need the
format=autospecial case for PDFs.Evidence
5.x, a project that defines the transformer can't use it:transformer('cdn')returns aCloudAssetTransformDriver. This is a 1200×750 WebP crop of a 4000×3000 photo with a focal point:composer ci(Pint, PHPStan, Pest):Related issues
Footnotes
An earlier revision also checked the bucket. Add Craft Cloud storage disks for Craft 6 #212's
craft-clouddisks are always S3 on the project's bucket, and a bucket check can't tell a dev bucket from Cloud's. Transforms on the CDN work wherever the original asset URLs do. ↩