Skip to content

Commit

Permalink
Masterbar: prevent dns prefetching for logged out users (#8171)
Browse files Browse the repository at this point in the history
Do not perform dns prefetching for logged out users since they won't
be able to see the masterbar anyway.
  • Loading branch information
vindl authored and dereksmart committed Nov 27, 2017
1 parent 244c3bd commit 1f532fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions modules/masterbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,4 @@

include dirname( __FILE__ ) . '/masterbar/masterbar.php';

Jetpack::dns_prefetch( array(
'//s0.wp.com',
'//s1.wp.com',
'//s2.wp.com',
'//0.gravatar.com',
'//1.gravatar.com',
'//2.gravatar.com',
) );

new A8C_WPCOM_Masterbar;
9 changes: 9 additions & 0 deletions modules/masterbar/masterbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ function __construct() {
return;
}

Jetpack::dns_prefetch( array(
'//s0.wp.com',
'//s1.wp.com',
'//s2.wp.com',
'//0.gravatar.com',
'//1.gravatar.com',
'//2.gravatar.com',
) );

// Atomic only - override user setting that hides masterbar from site's front.
// https://github.com/Automattic/jetpack/issues/7667
if ( jetpack_is_atomic_site() ) {
Expand Down

0 comments on commit 1f532fb

Please sign in to comment.