开发者

wp-super-cache, reload from php

Is it possible to reload (or delete) the wp-super-cache from a php script? Is 开发者_JS百科there a specific function for that?


http://ocaoimh.ie/wp-super-cache-developers/ says:

Clearing the Cache

The development version of the plugin includes the following function. However, as this code hasn’t been released you cannot depend on this function being available on WordPress blogs just yet.

1    function wp_cache_clear_cache() {
2            global $cache_path;
3            prune_super_cache( $cache_path . 'supercache/', true );
4            prune_super_cache( $cache_path, true );
5    }

If you need this functionality in a plugin now, call prune_super_cache() directly. Please sanity check it however as it’s a very powerful command!

Delete the cache files for a single post by using the wp_cache_post_change( $post_id ) function. It will attempt to delete every half-on cache file for that post, as well as any supercache files.


You can reload it from the administration panel. If you want to do it remotely, you can write a script that simply

rm -rf [cache dir]

Just see where you have that dir.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜