Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress.com Toolbar: prevent dns prefetching for logged out users #8171

Merged
merged 1 commit into from
Nov 27, 2017

Conversation

vindl
Copy link
Member

@vindl vindl commented Nov 14, 2017

Do not perform dns prefetching for logged out users since they won't be able to see the masterbar anyway.

We are relying on the fact that the masterbar is an extension of the default admin bar, which is only loading for logged in users. Further more, the dns_prefetch call is placed after the bail that checks if current user is WP.com connected one, so this will be executed only for users that will actually see the masterbar.

Fixes #8089

Testing instructions:

  1. Use a test Jetpack site with WordPress.com Toolbar module activated.
  2. When viewing the homepage while logged in you should be able to see the following lines in HTML source:
<link rel='dns-prefetch' href='//s0.wp.com'/>
<link rel='dns-prefetch' href='//s1.wp.com'/>
<link rel='dns-prefetch' href='//s2.wp.com'/>
<link rel='dns-prefetch' href='//0.gravatar.com'/> 
<link rel='dns-prefetch' href='//1.gravatar.com'/>
<link rel='dns-prefetch' href='//2.gravatar.com'/>
  1. Verify that the lines above are not present when viewing the page logged out.

Note: some other active modules may also prefetch these URLs.

Do not perform dns prefetching for logged out users since they won't
be able to see the masterbar anyway.
@vindl vindl added [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Focus] Performance [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Type] Bug When a feature is broken and / or not performing as intended labels Nov 14, 2017
@vindl vindl added this to the 5.6 milestone Nov 14, 2017
@vindl vindl self-assigned this Nov 14, 2017
@vindl vindl requested review from jeherve and a team November 14, 2017 23:31
@vindl vindl requested a review from a team as a code owner November 14, 2017 23:31
@vindl vindl requested a review from oskosk November 27, 2017 13:04
Copy link
Contributor

@oskosk oskosk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oskosk oskosk added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 27, 2017
@dereksmart dereksmart merged commit 1f532fb into master Nov 27, 2017
@dereksmart dereksmart deleted the fix/8089-masterbar-prefetch branch November 27, 2017 16:08
@dereksmart dereksmart removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 27, 2017
jeherve added a commit that referenced this pull request Nov 28, 2017
oskosk pushed a commit that referenced this pull request Nov 28, 2017
* Changelog 5.6: create base for changelog.

* Update changelog with 5.5.1 info.

* Changelog: add #7930 and #8238

* Changelog: add #8076

* Changelog: add #8100

* Changelog: add #8117

* Changelog: add #8141

* Changelog: add #8143

* Changelog: add #8147

* Changelog: add #8149

* Changelog: add #8153

* Changelog: add #8173

* Changelog: add #8184

* Changelog: add #8196

* Changelog: add #8199

* Changelog: add #8093

* Changelog: add #8171

* Changelog: add #8182

* Changelog: add #8202, #8222

* Changelog: add #8228

* Changelog: add #8240

* Changelog: add #8251

* remove AL card change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Focus] Performance [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants