razvanstanga / varnish-caching-wordpress-plugin

Varnish Cache Wordpress implementation
18 stars 5 forks source link

vcaching: ensure cache is not purged on any comment change #13

Closed softmanro closed 1 year ago

softmanro commented 4 years ago

The original code uses a hook on edit_post which triggers regarding on any post change, including comment transitions. For example, if your Wordpress is configured with all comments getting into moderation queue, the 1.8.3 version of the plugin will purge the varnish case whenever you mark a comment as spam, unmark it & so on. This patch removes the edit_post hook and adds another specific hook for comment transition. Only the changes that would make the comment visible or not visible will trigger a purge action this way.