Problem/Motivation

Hi! Looking at drupal_flush_all_caches() (which is called if you drush cr or use e.g. rebuild_cache_access module) doesn't actually trigger this module's cache clear. Looking at Core code, it looks like we should implement CacheTagsPurgeInterface from core.

Steps to reproduce

Attempt to clear cache and see if cloudflare cache is clear.

Proposed resolution

Not sure if that should be an opt-in behaviour or not? I guess that's the first thing to decide. After that implementing CacheTagsPurgeInterface is probably quite simple since it only has 1 method ('purge').

Remaining tasks

Decide on approach + implement

User interface changes

TBD

API changes

N/A

Data model changes

N/A

Comments

scott_euser created an issue. See original summary.

  • flashwebcenter committed 02fbaf17 on 3.1.x-dev
    Issue #3610356: Purge Cloudflare when all Drupal caches are flushed...

  • flashwebcenter committed 02fbaf17 on 3.1.x
    Issue #3610356: Purge Cloudflare when all Drupal caches are flushed...
flashwebcenter’s picture

Status: Active » Needs review

Hello,

Thanks for the report and the pointer to CacheTagsPurgeInterface. That was the right integration point.

The changes are now merged into the dev branch. CloudflareCacheTagInvalidator now implements CacheTagsPurgeInterface, so a full Drupal cache rebuild can trigger a full Cloudflare zone purge.

This is opt-in and disabled by default through the new purge_everything_on_flush setting under Automatic Cache Tag Purging. The purge is skipped during installation or when credentials are missing, and API failures are caught and logged so they cannot interrupt the cache rebuild.

Unit tests cover enabled, disabled, missing-credential, and API-failure scenarios.

Best wishes,
Alaa

scott_euser’s picture

Status: Needs review » Fixed

That's excellent thank you very much!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.