Cache is not being purged for encoded URLs characters (like Arabic slug...)

Hi,

I see that when the page URL is encoded (Like if the URL in the Arabic language), then Cloudflare can’t purge the cache for this URL. So, what I do is that I use this tool: https://www.urldecoder.org/ to decode the encoded URL and purge it on Cloudflare.

  1. Example of encoded URL (Cloudflare can’t purge its cache): www.example.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/

  2. Example of the same URL but decoded (this can be purged with Cloudflare): www.example.com/انشاء-موقع-الكتروني/

I see this bug for a year and was hopping to be fixed day by day… Its very annoying for our ar websites.

Please investigate and tell me if there are any proper solution.

Do you have Normalise Incoming URLs enabled?

I suspect @smarsh is the best person to give a definitive answer here, but could you try converting the percent encoded representations to UPPER case.

1 Like

No.

I can’t, Because in the Arabic language, there is no UPPER and Lower cases.

@smarsh Can you look into this please?

I mean the % encoded characters, your example above would become:

www.example.com/%D8%A7%A9%86%A8%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/

This is impossible and will make the URL broken (different one!).

It can be solved if I used a tool to decode it but this is annoying. We need a solution on the Cloudflare side to make these Arabic and I guess Chinese URLs being purged without the need to decode manually.

Percent encoding is not case sensitive, as per the RFC:

The uppercase hexadecimal digits ‘A’ through ‘F’ are equivalent to the lowercase digits ‘a’ through ‘f’, respectively. If two URIs differ only in the case of hexadecimal digits used in percent-encoded octets, they are equivalent. For consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings.

My thinking here is that the Cloudflare Cache may be normalising to a particular form, but the Purge may not perform the same normalisation.

let’s turn on Normalize Incoming URLs and try again :grinning:
credit to @michael

3 Likes

Hi @akrivit,

Great! It worked after I also enabled “Normalized to origin”:slight_smile: Thanks a lot for your help you saved a lot of my time.

Thanks all for help…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.