//admin bar nocache button
function add_custom_button_to_admin_menu_bar() {
global $wp_admin_bar;
$args = array(
'id' => 'custom-refresh-button',
'title' => 'Refresh with no cache',
'href' => add_query_arg( 'nocache', '1', get_permalink() ),
'meta' => array(
'onclick' => 'location.reload(true);'
)
);
$wp_admin_bar->add_node($args);
}
add_action('wp_before_admin_bar_render', 'add_custom_button_to_admin_menu_bar');