• I am having trouble determining why W3TC is telling my Varnish server to PURGE the string “/.*” (aka dump the entire cache) periodically. The time interval does not seem to be constant, nor does the frequency. I noticed my cache was being dumped at least once per day so finally I just sat down and watched the logs until I witnessed a PURGE command for “/.*” originating from W3TC.

    I started poking through the plugin code and I was able to prevent the plugin from ever again purging the entire cache at once. Purging individual posts/feeds/archives/etc. still works fine. I replaced the line that would dump the cache with an error_log() statement and I can tell that W3TC is still *attempting* to dump my cache 1-2 times per day. I am confused as to what WordPress action is triggering W3TC to send this PURGE command targeting the entire cache.

    Frederick, or anyone else who is familiar with the inner workings of W3TC: What are the situations that would cause W3TC to flush the entire cache like this?

    https://www.ads-software.com/plugins/w3-total-cache/

    [Moderator Note: No bumping, thank you.]

Viewing 1 replies (of 1 total)
  • Thread Starter dancriel

    (@dancriel)

    I greatly improved my site performance by combining my hack mentioned above (commenting out the PHP in W3TC which would dump the entire cache all at once) along with modifying, via my theme’s functions.php file, some of the hooks that W3TC uses to determine whether to purge an object. Eventually I will block this action at the reverse proxy level instead of within the plugin so W3TC becomes upgrade safe again.

    Example: W3TC will purge a post and any other associated objects (archives, feeds, etc.) depending on your settings when a comment is submitted but NOT approved for that post. So we were receiving Spam comments which were flagged by Akismet and dumped into either Spam or Trash, but yet W3TC still saw fit to purge the post from the cache immediately instead of waiting for the comment to actually be approved.

    Bottom line: the Varnish purge criteria in W3TC is too aggressive and fails to consider the status of comment objects before issuing purge commands each time the object is saved in the WordPress DB.

Viewing 1 replies (of 1 total)
  • The topic ‘Why is W3TC trying to purge my entire Varnish cache?’ is closed to new replies.