Slow Loading RSD URLs In WordPress

A common mechanism for XML-RPC clients to find out information about your WordPress blog is to look for the Really Simple Discovery (RSD) URL. The RSD contains information about the available APIs that WordPress supports. A typical discovery process would look something like this:

  1. Request your blog URL, http://example.com/ and look for the RSD link element
  2. Request the RSD URL and parse the provided info
  3. Determine which API information to use
  4. Communicate with your blog via the determined API

On rare occasions I’ve seen reports where the RSD URL (which looks like http://example.com/xmlrpc.php?rsd in WordPress) will take a very long time to load (3 minutes or more) even though the rest of the site responds very quickly. This can cause problems for XML-RPC clients (like the WordPress iPhone app) if they timeout trying to get the RSD data. The reports of this problem were few and far between, without much of a common thread. Until today.

Ticket 9380 showed up earlier today, reported by foks. Foks noticed that the SSL check being done when the RSD URL was requested didn’t have a timeout set, so if the conditions were just right it will wait for the system level timeout before failing. That explained why the RSD request would take so long in some cases. If you’ve run into this problem you can use the trivial one line patch or grab a copy of the wp-includes/functions.php file from the WordPress 2.7.x branch at http://core.trac.wordpress.org/browser/branches/2.7/wp-includes/functions.php?rev=10831&format=txt and try it out.

This fix has been applied to both the 2.7.x branch (meaning it will be part of a 2.7.2 release if there is one) and -trunk (meaning it will be part of the upcoming 2.8 release).

10 Comments

  1. Christopher McHugh

    Tue 24 Mar 2009 at 11:32 am

    Thank you SO Much for this! I have searched for the answer to this issue for several weeks. I applied the fix and have finally been able to use the iPhone WordPress app.

  2. This works great!

  3. I’ve follwed “known issues” for iphone for hours, and here is a solution done in the famous 5 minutes. You have my eternal thanks.

  4. Thanks, but the person who really deserves the credit is foks, who brought up the issue in this ticket: http://core.trac.wordpress.org/ticket/9380

  5. Thank you! This helped me out with my WordPress iPhone App!

  6. Thanks for shearing!
    This fixed the problem with the iphone app as described here: http://iphone.wordpress.org/faq/

  7. Good to hear it’s helping people.

  8. Thank’s very much, i was trying everything, and finaly this fixed the problem!

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2019 Joseph Scott

Theme by Anders NorénUp ↑