Making WordPress.org

Opened 22 months ago

Closed 7 months ago

Last modified 7 months ago

#6769 closed enhancement (fixed)

Plugin pages should prewarm s.w.org

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords: seo performance
Cc:

Description (last modified by jonoaldersonwp)

Plugin pages like https://id.wordpress.org/plugins/tiny-compress-images/ are often slow to load.

As an easy win, we can pre-warm the connection to s.w.org and ps.w.org, which host various resources for the page.

To do this, we should add the following meta tags:

<link rel="dns-prefetch" href="https://s.w.org">
<link rel="preconnect" href="https://s.w.org">
<link rel="dns-prefetch" href="https://ps.w.org">
<link rel="preconnect" href="https://ps.w.org">

Change History (6)

#1 @jonoaldersonwp
22 months ago

  • Description modified (diff)

#2 @dd32
22 months ago

Is both preconnect and dns-prefetch required? Doesn't preconnect infer dns-prefetch?

Any change related to s.w.org should probably be done globally, not specifically for the plugin directory. Especially if we were to put the CDN to proper use; https://github.com/WordPress/wporg-mu-plugins/pull/173

We probably don't want to add a preconnect to s.w.org either, as the majority of resources served from there are expected to be cached.

A dns-prefetch for ps.w.org seems sane, but again, preconnect feels like it might be a bit too aggressive.

#3 @jonoaldersonwp
22 months ago

Browsers which don't support preconnect will fall back to dns-prefetch gracefully when both are included, and preconnect 'includes' dns-prefetch. So having both is good practices.

I'd be nervous about doing this globally, as there's a cost to (either) hint if/when it's not used.

We should do this regardless of caching, as the browser still needs to do the HTTPS handshake, etc, and getting that started sooner saves a bunch of time.

#4 @jonoaldersonwp
22 months ago

I'd be nervous about doing this globally, as there's a cost to (either) hint if/when it's not used.

*If there are other places these are hit, then I'd love to do it there, too. I'd just started with these locations as easy wins.

#5 @dd32
7 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 13674:

Plugin Directory: Add resource hints for dns-prefetch.

Fixes #6769.

#6 @dd32
7 months ago

I can't find anywhere else where we're using preconnect on WordPress.org, other than for Google fonts, and I'm hesitant to add preconnects here as it's plausible that all the resources being fetched from the CDNs are locally cached.

Note: See TracTickets for help on using tickets.