Site runs on a backend (BE) WP server and several frontend (FE) servers.
FE has MySQL db r/o Slave of the BE, and WP installation with HyperDB plugin, so it reads from local, writes to the BE. W3TC plugin is used for caching on FE‘s.
New posts are created on the BE. Publishing these posts triggers hooks only on the BE.
Question: how can these hooks be triggered also on all the FE‘s to reset their caching?
p.s. I asked the similar question in W3TC plugin support forum a while ago, no replies.
You can do that by using mini plugins on both FE and BE. The logic works like below;
username
,password
andpost_id
username
,password
, andpost_id
W3_CacheFlush
and call specific function.I have developed mini plugins, you can install them from admin panel. Simply, save both code as php file and zip it. Then upload to server. And also there are some important points on plugins. Serivce communication is made by username and password. So you need to give same username and password on both plugins. If not, they cannot communicate. I have put username and password to prevent another person to make call to your FE service. Here is the plugins.
W3TC_BE.php
W3TC_FE.php