Thanks for your feedback to my inquiry in my first reply, @ivancza. I thought this would be the case when mapping different domains to each language and am glad you’ve confirmed this.
I’ll have to think about if and how I would like to add this to the core. In the meantime you can extend Cache Enabler to resolve this by adding the following snippet to your website, like in your functions.php
file:
add_action( 'cache_enabler_site_cache_cleared', 'cache_enabler_clear_wpml_sites_cache' );
function cache_enabler_clear_wpml_sites_cache() {
// language site(s) when the WPML "A different domain per language" setting is enabled (do not include primary site)
$wpml_sites = array(
'https://example.hu',
'https://example.de',
);
// clear each language site cache after primary site cache is cleared
foreach ( $wpml_sites as $wpml_site ) {
$clear_type = 'subpages';
Cache_Enabler::clear_page_cache_by_url( $wpml_site, $clear_type );
}
}
The above snippet will clear each language site cache after the primary site cache is cleared, whether that is done manually, like through the WordPress admin bar button, or automatically if an enabled Cache Enabler setting triggers this.