Making WordPress.org

Opened 8 months ago

Last modified 8 months ago

#6769 new enhancement

Plugin pages should prewarm s.w.org

Reported by: jonoaldersonwp's profile jonoaldersonwp Owned by:
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 (4)

#1 @jonoaldersonwp
8 months ago

  • Description modified (diff)

#2 @dd32
8 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
8 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
8 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.

Note: See TracTickets for help on using tickets.