[wp-hackers] AJAX and responsiveness

Matt Mullenweg m at mullenweg.com
Thu Aug 17 07:17:57 GMT 2006

Part of the perceived speed of WP has nothing to do with execution, but 
how it feels. Some of the new AJAX, for example deleting and approving 
and unapproving comments, does save pageloads but I think under high 
latency situations (ie, dialup) it actually makes WP seem slower and 
sometimes broken. (But dangit if I don't love the approve/unapprove blinky.)

The issue is twofold:

1. We wait for a response from the server before updating the UI
2. If you try to fire off two at once, things break

For those of you lucky enough to have fast servers and connections, try 
adding something like a sleep(1) to the top of comment.php.

1. Go to the comments screen.
2. Click the approve/unapprove, notice how the delay is annoying
3. Now do two in a row, if the first AJAX request hasn't finished, it 
takes you to another page

I don't think there's anything wrong with updating the UI immediately as 
a result of the user's actions, and then queuing up the requests to run 
in the background. (And queuing them, not breaking if more than one 
lines up at the same time.)

Anyone have any proposed solutions or patches for this?

Matt Mullenweg
  http://photomatt.net | http://wordpress.org
http://automattic.com | http://akismet.com

More information about the wp-hackers mailing list