Title: wp-cli or flush cache from command line
Last modified: August 22, 2016

---

# wp-cli or flush cache from command line

 *  [disagree](https://wordpress.org/support/users/disagree/)
 * (@disagree)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/)
 * I understand you don’t have a wp-cli integration yet – however this makes things
   a bit tough for automated deployments. When CSS/JS files change, we would have
   to go into each install and flush cache manually.
 * Is there a way to trigger a flush cache from command line?
 * Or could it be added to the plugin deactivate/activate functions to keep it simple?
 * [https://wordpress.org/plugins/bwp-minify/](https://wordpress.org/plugins/bwp-minify/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5233927)
 * Hey,
 * When CSS/JS files changed you don’t actually need to flush the cache directory.
   Flushing the cache directory won’t help anyway for old users if user does not
   press F5 or Ctrl+F5. Once F5 or Ctrl+F5 is pressed cached files are checked against
   current files (now changed) and are updated automatically.
 * You can, however, add a cache buster to the minify string by applying a filter
   to this hook: `bwp_minify_get_src`, something like:
 *     ```
       add_filter('bwp_minify_get_src', 'append_cache_buster');
       function append_cache_buster($minify_string)
       {
           return $minify_string . '&ver=' . '1234567890';
       }
       ```
   
 *  Thread Starter [disagree](https://wordpress.org/support/users/disagree/)
 * (@disagree)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5233974)
 * I don’t understand the cache buster part – e.g. that it’s not updated if the 
   source files change – aren’t you creating md5 based on the source css/js files
   date timestamps or checksums?
 * so if i have style.css and style1.css i have another checksum than when style1.
   css was being altered meanwhile? the ctrl+f5 idea is not a good solution
 *  Thread Starter [disagree](https://wordpress.org/support/users/disagree/)
 * (@disagree)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5233976)
 * ( i mean i understand it programmatically, but i thought bwp was taking care 
   of file changes already )
 *  Thread Starter [disagree](https://wordpress.org/support/users/disagree/)
 * (@disagree)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5234200)
 * Hey Khang,
 * Is it possible to adjust the filename of the generated css/js file based on the
   md5 checksum of the contents?
 * That way could push the css files to CDN without fearing for cache issues, and
   could drop the ?ver= parameters which are bad for frontend caching and micro 
   cache proxies like varnish.
 * E.g. right now the .js result I get is this :
 * `/cache/minify-b1-flexslider-684c1e3d23b06bc0b7d1a6d2ed4e90de.js?ver=1413915527`
 * Once I change one of the files, it currently just changes the last part of the
   url ( the ver= part )
 * `/cache/minify-b1-flexslider-684c1e3d23b06bc0b7d1a6d2ed4e90de.js?ver=1414633462`
 * Any way to simply change the 684c1e3d23b06bc0b7d1a6d2ed4e90de checksum based 
   on the file contents instead?
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5234203)
 * Changing the hash sounds like a good idea, however not possible at the moment.
   You can modify the code to achieve that (file `includes/class-bwp-minify-fetcher.
   php`), for example:
 *     ```
       $group_hash       = md5($original_string . $detector_version . apply_filters('bwp_minify_build_number', ''));
       ```
   
 * and then add a filter at a suitable place.
 *  Thread Starter [disagree](https://wordpress.org/support/users/disagree/)
 * (@disagree)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5234204)
 * Thanks Khang
 * I’ll review and send you a PR to github, so your future updates won’t overwrite
   those changes 🙂
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5234227)
 * Have you ever got the chance to create a PR :)?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘wp-cli or flush cache from command line’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bwp-minify.svg)
 * [Better WordPress Minify](https://wordpress.org/plugins/bwp-minify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bwp-minify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bwp-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/bwp-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bwp-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bwp-minify/reviews/)

## Tags

 * [bwp](https://wordpress.org/support/topic-tag/bwp/)
 * [flush cache](https://wordpress.org/support/topic-tag/flush-cache/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 7 replies
 * 2 participants
 * Last reply from: [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/wp-cli-or-flush-cache-from-command-line/#post-5234227)
 * Status: not resolved