- Issue created by @kleinmp
- Status changed to RTBC
12 months ago 9:48pm 11 December 2023 - last update
12 months ago Composer require failure - πΊπΈUnited States Jody Lynn
Confirmed that we are running this patch in production and our Cloudflare cache hit rate increased significantly
- π¦πΊAustralia almunnings Melbourne, π¦πΊ
This patch has worked well us.
We were seeing excessive collisions across entities, and Cloudflare was invalidating completely unrelated content.This patch is excellent
- π¬π§United Kingdom altcom_neil
Hi
We also ran into this issue and another related issue - cache tags in the same Cloudflare account will clear all environments - so the UAT sites cache tags will clear the production sites cache if you are using the same account during development. We have added a patch that allows you to prefix the cache tag with an environment character so that cache tags are unique per environment.
See https://www.drupal.org/project/cloudflare/issues/3394651 β¨ Add optional Environment setting Needs reviewIn that code we increased the length of the hashed cache tag (before adding the environment character) to 6 characters (giving 16.7 million unique codes) - as we didn't spot the better improvement of using the larger character set that you have used here. We have been using this code on sites with in the excess of 100,000 nodes and we haven't run into any header size issues so 4 character tags should be fine.
If you do use 6 characters in the hash then you are up to over 2 billion unique hashes!Should the length of the hash value be a config value - with a minimum of 4 so that it can be configured on a site-by-site basis? Very, very, very, very (etc) large sites would potentially have more than 1.6 million cache tags if they have millions of entities?
Cheers, Neil
- Status changed to Fixed
7 months ago 10:59am 15 April 2024 - π¨π¦Canada mandclu
Thanks @kleinmp for identifying this, and for providing a fix. Merged in.
-
mandclu β
committed bbfb0a7d on 2.0.x
Issue #3401335 by kleinmp, mandclu: Excessive Tag Hash Collisions
-
mandclu β
committed bbfb0a7d on 2.0.x
Automatically closed - issue fixed for 2 weeks with no activity.