Tag hashes should be unique to a site

Created on 31 July 2025, 2 days ago

Problem/Motivation

The Cloudflare purge by tag feature operates on an entire zone, not a specific domain within the zone. This proves troublesome for users that are running multiple domains in that cache invalidation can happen too liberally.

This has the potential to be very troublesome for users with dozens or hundreds of domains in one zone.

Steps to reproduce

I have not manually tested this as I do not have the authority to perform this kind of zone modification. Steps to reproduce are theoretical.

  1. Set up a Cloudflare zone: example.com
  2. Set up two websites in said zone: a.example.com and b.example.com
  3. Ensure that a page is cached on both domains that has the node_list cache tag (for example)
  4. Update a node on a.example.com
  5. Verify that the page on a.example.com was invalidated -- great! This is expected!
  6. Also see that the page on b.example.com was also invalidated! -- ouch!

This happens because the node_list cache tag is effectively colliding between the two domains.

Proposed resolution

Incorporate the site UUID or some other unique identifier into the hash calculation to ensure that cache tags are unique to the domain they're generated on.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @luke.leber
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Just a note that if/when we implement this, we'll need a release note to indicate that the entire Cloudflare cache should be purged, because all the cache tags will have changed.

Production build 0.71.5 2024