Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
New flush() for APC object Cache - accounts for multiple sites on using one cache.
function flush() {
// Don't flush if multi-blog.
if ( function_exists( 'is_site_admin' ) || defined( 'CUSTOM_USER_TABLE' ) && defined( 'CUSTOM_USER_META_TABLE' ) )
return true;
$user_cache = apc_cache_info( 'user' );
foreach( $user_cache['cache_list'] as $cache_entry ) {
if ( false !== strstr( $cache_entry['info'], WP_APC_KEY_SALT . ':' . $this->abspath ) )
apc_delete( $cache_entry['info'] );
}
return true;
// return apc_clear_cache( 'user' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.