From 9d29e8fa2826aaf95ed3c23142ca65890626ebd8 Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Sun, 5 Apr 2026 17:03:24 +0800 Subject: [PATCH 1/5] doc: Update Cloudflare purge-by-tag availability for all plans --- doc/proxy-clients.rst | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/proxy-clients.rst b/doc/proxy-clients.rst index e21e0b5a..3b7109fb 100644 --- a/doc/proxy-clients.rst +++ b/doc/proxy-clients.rst @@ -26,14 +26,13 @@ Varnish ✓ ✓ ✓ ✓ ✓ Fastly ✓ ✓ ✓ ✓ NGINX ✓ ✓ Symfony Cache ✓ ✓ ✓ (1) ✓ (1) -Cloudflare ✓ ✓ (2) ✓ (2) ✓ +Cloudflare ✓ ✓ ✓ ✓ Noop ✓ ✓ ✓ ✓ ✓ ✓ Multiplexer ✓ ✓ ✓ ✓ ✓ ✓ ============= ======= ======= ======= ======= ========= ======= | (*): A limited version of Ban, that allows to invalidate by the beginning of a path | (1): Only when using `Toflar Psr6Store`_. -| (2): Only available with `Cloudflare Enterprise`_. If needed, you can also implement your own client for other needs. Have a look at the interfaces in namespace ``FOS\HttpCache\ProxyClient\Invalidation``. @@ -353,13 +352,6 @@ the HttpDispatcher is not available for Cloudflare):: $cacheInvalidator->invalidatePath('https://example.com/path')->flush(); -.. note:: - - Cloudflare supports different cache purge methods depending on your account. - All Cloudflare accounts support purging the cache by URL and clearing all - cache items. You need a `Cloudflare Enterprise`_ account to purge by cache - tags or prefixes. - Zone identifier ^^^^^^^^^^^^^^^ To find the zone identifier for your domain request this from the API:: @@ -456,5 +448,4 @@ requests. .. _Cloudflare: https://developers.cloudflare.com/cache/ .. _custom caching with page rules: https://support.cloudflare.com/hc/en-us/articles/360021023712-Best-Practices-Speed-up-your-Site-with-Custom-Caching-via-Cloudflare-Page-Rules .. _Cloudflare Purge API: https://api.cloudflare.com/#zone-purge-all-files -.. _Cloudflare Enterprise: https://developers.cloudflare.com/cache/how-to/purge-cache#cache-tags-enterprise-only .. _Cloudflare Purge by URL: https://developers.cloudflare.com/cache/how-to/purge-cache#purge-by-single-file-by-url From a7f18b3bdd66ffcf3f23ea9f1b9c2e835765eb9c Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Sun, 5 Apr 2026 17:10:12 +0800 Subject: [PATCH 2/5] Remove enterprise account limitations comments --- src/ProxyClient/Cloudflare.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ProxyClient/Cloudflare.php b/src/ProxyClient/Cloudflare.php index c9101568..ca859fad 100644 --- a/src/ProxyClient/Cloudflare.php +++ b/src/ProxyClient/Cloudflare.php @@ -67,8 +67,6 @@ public function __construct( /** * {@inheritdoc} * - * Tag invalidation only available with Cloudflare enterprise account - * * @see https://api.cloudflare.com/#zone-purge-files-by-cache-tags,-host-or-prefix */ public function invalidateTags(array $tags): static @@ -91,8 +89,6 @@ public function invalidateTags(array $tags): static /** * {@inheritdoc} * - * URL prefix only available with Cloudflare enterprise plans. - * * The prefixes need to include the domain name, but not the protocol, e.g. "www.example.com/path" * * @see https://developers.cloudflare.com/api/resources/cache/methods/purge/ From 3459463bb17afa3e3f1fc70a32db26f0720407ff Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Mon, 6 Apr 2026 23:43:37 +0800 Subject: [PATCH 3/5] fix cs --- src/ProxyClient/Cloudflare.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ProxyClient/Cloudflare.php b/src/ProxyClient/Cloudflare.php index ca859fad..30c409ca 100644 --- a/src/ProxyClient/Cloudflare.php +++ b/src/ProxyClient/Cloudflare.php @@ -65,8 +65,6 @@ public function __construct( } /** - * {@inheritdoc} - * * @see https://api.cloudflare.com/#zone-purge-files-by-cache-tags,-host-or-prefix */ public function invalidateTags(array $tags): static From 8a58c1fe9acf0208670df96d286e97018b7921d5 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Mon, 6 Apr 2026 19:48:21 +0200 Subject: [PATCH 4/5] Update src/ProxyClient/Cloudflare.php --- src/ProxyClient/Cloudflare.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ProxyClient/Cloudflare.php b/src/ProxyClient/Cloudflare.php index 30c409ca..ca859fad 100644 --- a/src/ProxyClient/Cloudflare.php +++ b/src/ProxyClient/Cloudflare.php @@ -65,6 +65,8 @@ public function __construct( } /** + * {@inheritdoc} + * * @see https://api.cloudflare.com/#zone-purge-files-by-cache-tags,-host-or-prefix */ public function invalidateTags(array $tags): static From 6d3578899f87bdbd754539f4a825c81f921f5647 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Mon, 6 Apr 2026 19:50:19 +0200 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: David Buchmann --- src/ProxyClient/Cloudflare.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ProxyClient/Cloudflare.php b/src/ProxyClient/Cloudflare.php index ca859fad..30c409ca 100644 --- a/src/ProxyClient/Cloudflare.php +++ b/src/ProxyClient/Cloudflare.php @@ -65,8 +65,6 @@ public function __construct( } /** - * {@inheritdoc} - * * @see https://api.cloudflare.com/#zone-purge-files-by-cache-tags,-host-or-prefix */ public function invalidateTags(array $tags): static