Can I flush W3TC’s cache in a capistrano deploy?

I’m trying to simplify my deploy process and am making use of the Capistrano tool. Is there a way to have capistrano flush W3TC’s cache in a deploy task?

Related posts

Leave a Reply

2 comments

  1. As @andreascreten, wp-cli will do the job for you.

    wp-cli includes commands for W3TC (located in the src/php/wp-cli/commands/community/total-cache.php file), so you can flush the cache by running:

    $ wp total-cache flush <type>
    

    Where <type> is one of ‘db’, ‘minify’, ‘object’, ‘page’ or ‘post’.

    (Note: If you use ‘post’, you’ll need to pass in --post_id= or --permalink= as well)