From 85d2b9cf89060a00de9c91d9b010b62cb3432b1a Mon Sep 17 00:00:00 2001 From: Angela Costa Date: Wed, 7 Sep 2022 18:51:40 +0100 Subject: [PATCH 1/8] Added section about purge by prefix normalization --- content/cache/how-to/purge-cache.md | 116 ++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index b5c5b93c362252..82578ec7fb25e6 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -158,6 +158,122 @@ Example: If you purge `foo.com/bar`, any asset that starts with `foo.com/bar` wi {{}} +### Purge by prefix normalization + +Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the URL normalization. We are changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on . + +#### How does URL Normalization work + +As an example of this behavior change, take the following website as an example: `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. The table below shows you how Cloudflare’s cache views these paths with normalization on/off. + + + + + + + + + + + + + + + + + + + + + + +
+ Request from visitor to EDGE + + What Cloudflare cache sees with Normalize Incoming URLs ON + + What Cloudflare cache sees with Normalize Incoming URLs OFF +
+ https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg + + https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg + + https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg +
+ https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg + + https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg + + https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jp +
+ https://cloudflare.com/hello/img_1.jpg + + https://cloudflare.com/hello/img_1.jpg + + https://cloudflare.com/hello/img_1.jpg +
+ +#### Behavior change + +If you try to purge by prefix, this will happen: + + + + + + + + + + + + + + + + + + + + + + +
+ Purging By Prefix + + Purge By Prefix (current behavior) + + Purge By Prefix (new behavior) +
+ clouflare.com/انشاء-موقع-الكتروني/ + + cloudflare.com/انشاء-موقع-الكتروني/ + + cloudflare.com/انشاء-موقع-الكتروني/ +
+ cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/ + + cloudflare.com/انشاء-موقع-الكتروني/ + + cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/ +
+ cloudflare.com/hello/ + + cloudflare.com/hello/ + + cloudflare.com/hello/ +
+ +This means that if the prefix being purged does not match what Cloudflare’s cache sees, regardless of how the URL looked when it hit the edge, purge by prefix will not work. Specifically: + +- If the visitor request was for `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg`, then currently purge by prefix will not be able to purge this asset because no matter what prefix you try to purge, for instance `cloudflare.com/انشاء-موقع-الكتروني/` or `cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg`, what will be purged is `cloudflare.com/انشاء-موقع-الكتروني/` which will not match the asset that was cached by the visitor request. + + With the new behavior, purging by prefix `cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/` will purge the asset cached by the visitor request for `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg`. + +- Currently, if a visitor request was for `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg` and URL normalization is ON, then currently purge by prefix will not be able to purge this asset since it will be cached as if `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg` was requested and, similarly to the first point, we can not purge this with the current behaviour. If, on the other hand, URL normalization is OFF, then purging by prefix `cloudflare.com/انشاء-موقع-الكتروني/` will purge `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. + + With the new behavior, in order to purge by prefix the asset that was cached by the visitor request `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`, you can purge by prefix `cloudflare.com/انشاء-موقع-الكتروني/`. + ## Purge cache key resources Purge resources that use Cache Keys via the [Cloudflare API](https://api.cloudflare.com/#zone-purge-files-by-url). If you use [Cloudflare’s Purge by URL](https://api.cloudflare.com/#zone-purge-files-by-url), include the headers and query strings that are in your custom Cache Key. From d62a8793da50b527130a31b80174b8a81ea53991 Mon Sep 17 00:00:00 2001 From: Angela Costa Date: Thu, 8 Sep 2022 09:59:20 +0100 Subject: [PATCH 2/8] Corrections after review --- content/cache/how-to/purge-cache.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index 82578ec7fb25e6..5da1f7e0b10d5b 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -160,11 +160,11 @@ Example: If you purge `foo.com/bar`, any asset that starts with `foo.com/bar` wi ### Purge by prefix normalization -Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the URL normalization. We are changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on . +Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the [URL normalization](https://developers.cloudflare.com/rules/normalization/). We are changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on . #### How does URL Normalization work -As an example of this behavior change, take the following website as an example: `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. The table below shows you how Cloudflare’s cache views these paths with normalization on/off. +As an example of this behavior change, take the following website as an example: `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. The table below shows you how Cloudflare’s cache views these paths with [normalization on/off](https://developers.cloudflare.com/rules/normalization/). @@ -220,13 +220,13 @@ If you try to purge by prefix, this will happen:
From 37fd3316164d65577e589067300e04e78fb6b2d4 Mon Sep 17 00:00:00 2001 From: Angela Costa Date: Tue, 20 Sep 2022 10:24:33 +0100 Subject: [PATCH 8/8] Added date. --- content/cache/how-to/purge-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index a57c3532706d1e..780c02bc1ac3b1 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -160,7 +160,7 @@ Example: If you purge `foo.com/bar`, any asset that starts with `foo.com/bar` wi ### Purge by prefix normalization -Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the [URL normalization](/rules/normalization/). Cloudflare is changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on . +Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the [URL normalization](/rules/normalization/). Cloudflare is changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on October 12th, 2022. #### How does URL Normalization work
- Purging By Prefix + What the user wants to purge - Purge By Prefix (current behavior) + What the EDGE purges (current behavior) - Purge By Prefix (new behavior) + What the EDGE purges (new behavior)
From cf25f5043acc7a2dabb70ec3696bb741890539bf Mon Sep 17 00:00:00 2001 From: angelampcosta <92738954+angelampcosta@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:51:43 +0100 Subject: [PATCH 3/8] Update content/cache/how-to/purge-cache.md Co-authored-by: marciocloudflare <83226960+marciocloudflare@users.noreply.github.com> --- content/cache/how-to/purge-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index 5da1f7e0b10d5b..2da35b32244fe3 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -160,7 +160,7 @@ Example: If you purge `foo.com/bar`, any asset that starts with `foo.com/bar` wi ### Purge by prefix normalization -Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the [URL normalization](https://developers.cloudflare.com/rules/normalization/). We are changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on . +Currently, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service does not respect the [URL normalization](/rules/normalization/). Cloudflare is changing the purge by prefix functionality so that normalized URLs will be purged as expected. We plan for this change to occur on . #### How does URL Normalization work From e23ce56e5beca9469b383dc7025c649fb846ad93 Mon Sep 17 00:00:00 2001 From: angelampcosta <92738954+angelampcosta@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:51:55 +0100 Subject: [PATCH 4/8] Update content/cache/how-to/purge-cache.md Co-authored-by: marciocloudflare <83226960+marciocloudflare@users.noreply.github.com> --- content/cache/how-to/purge-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index 2da35b32244fe3..27439b32895e87 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -164,7 +164,7 @@ Currently, when a purge by prefix request comes into Cloudflare for a normalized #### How does URL Normalization work -As an example of this behavior change, take the following website as an example: `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. The table below shows you how Cloudflare’s cache views these paths with [normalization on/off](https://developers.cloudflare.com/rules/normalization/). +As an example of this behavior change, take the following website as an example: `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. The table below shows you how Cloudflare’s cache views these paths with [normalization on/off](/rules/normalization/). From 80c304b86e7086adac8e6c7b525efa6e3e76a97a Mon Sep 17 00:00:00 2001 From: angelampcosta <92738954+angelampcosta@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:52:14 +0100 Subject: [PATCH 5/8] Update content/cache/how-to/purge-cache.md Co-authored-by: marciocloudflare <83226960+marciocloudflare@users.noreply.github.com> --- content/cache/how-to/purge-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index 27439b32895e87..120c05dff592bd 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -264,7 +264,7 @@ If you try to purge by prefix, this will happen:
-This means that if the prefix being purged does not match what Cloudflare’s cache sees, regardless of how the URL looked when it hit the edge, purge by prefix will not work. Specifically: +This means that if the prefix being purged does not match what Cloudflare’s cache sees purge by prefix will not work, regardless of how the URL looked when it hit the edge. Specifically: - If the visitor request was for `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg`, then currently purge by prefix will not be able to purge this asset because no matter what prefix you try to purge, for instance `cloudflare.com/انشاء-موقع-الكتروني/` or `cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg`, what will be purged is `cloudflare.com/انشاء-موقع-الكتروني/` which will not match the asset that was cached by the visitor request. From 4dfc62dc257a1f2d8bb4f4a718efb3fa433d1304 Mon Sep 17 00:00:00 2001 From: angelampcosta <92738954+angelampcosta@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:52:25 +0100 Subject: [PATCH 6/8] Update content/cache/how-to/purge-cache.md Co-authored-by: marciocloudflare <83226960+marciocloudflare@users.noreply.github.com> --- content/cache/how-to/purge-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index 120c05dff592bd..2f803c55b93cd2 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -270,7 +270,7 @@ This means that if the prefix being purged does not match what Cloudflare’s ca With the new behavior, purging by prefix `cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/` will purge the asset cached by the visitor request for `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg`. -- Currently, if a visitor request was for `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg` and URL normalization is ON, then currently purge by prefix will not be able to purge this asset since it will be cached as if `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg` was requested and, similarly to the first point, we can not purge this with the current behaviour. If, on the other hand, URL normalization is OFF, then purging by prefix `cloudflare.com/انشاء-موقع-الكتروني/` will purge `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. +- Currently, if a visitor request was for `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg` and URL normalization is **ON**, then currently purge by prefix will not be able to purge this asset since it will be cached as if `https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg` was requested and, similarly to the first point, we can not purge this with the current behaviour. If, on the other hand, URL normalization is **OFF**, then purging by prefix `cloudflare.com/انشاء-موقع-الكتروني/` will purge `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`. With the new behavior, in order to purge by prefix the asset that was cached by the visitor request `https://cloudflare.com/انشاء-موقع-الكتروني/img_1.jpg`, you can purge by prefix `cloudflare.com/انشاء-موقع-الكتروني/`. From d37c923794e719cb46841b55b51e904f8bc4fd78 Mon Sep 17 00:00:00 2001 From: angelampcosta <92738954+angelampcosta@users.noreply.github.com> Date: Thu, 8 Sep 2022 11:52:32 +0100 Subject: [PATCH 7/8] Update content/cache/how-to/purge-cache.md Co-authored-by: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> --- content/cache/how-to/purge-cache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cache/how-to/purge-cache.md b/content/cache/how-to/purge-cache.md index 2f803c55b93cd2..a57c3532706d1e 100644 --- a/content/cache/how-to/purge-cache.md +++ b/content/cache/how-to/purge-cache.md @@ -196,7 +196,7 @@ As an example of this behavior change, take the following website as an example: https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg
- https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jp + https://cloudflare.com/%D8%A7%D9%86%D8%B4%D8%A7%D8%A1-%D9%85%D9%88%D9%82%D8%B9-%D8%A7%D9%84%D9%83%D8%AA%D8%B1%D9%88%D9%86%D9%8A/img_1.jpg