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
Comment #4
flashwebcenterHello,
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
Comment #5
scott_euser commentedThat's excellent thank you very much!