[wp-hackers] AJAX and responsiveness

Peter Westwood peter.westwood at ftwr.co.uk
Thu Aug 17 07:50:33 GMT 2006

On Thu, August 17, 2006 8:17 am, Matt Mullenweg wrote:
> 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 2, you need to something clever in the javascript.  The current code
assumes a single delete at a time and messes up - The patch I wrote up a
while ago for multiple delete in the link manager worked around this with
improved ajax routines (see http://trac.wordpress.org/ticket/923 and in
which also warn you if one is currently in progress rather than
overwriting the state information.

I doubt that patch applies to trunk as it is over a year old!

> 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.)

Updating the UI before the action has completed sounds a little dangerous
- how do we get the deleted item back if it was rejected by the wordpress

> Anyone have any proposed solutions or patches for this?

What about a fade over box which says something like delete in progress
and greys out the page - displaying useful progress messages by hooking
into the sack events and the ajax request progresses?

Peter Westwood <peter.westwood at ftwr.co.uk>

More information about the wp-hackers mailing list