[wp-hackers] Autosave

Brad Fults bfults at gmail.com
Mon Jan 2 19:31:48 GMT 2006


On 1/2/06, Matt Mullenweg <m at mullenweg.com> wrote:
> I'm hesitant to put auto-saves or emergency recovery info in the posts
> table. The publishing model of WP is very different from Gmail. In Gmail
> you are composing until it is sent, then it's gone forever. In WordPress
> you may edit something constantly.

Agreed, it should be put in the DB as a user option which will hold
only one lost post at a time.

> I'm not sold on the DB vs. cookies idea yet. I've been on a lot of
> high-latency connections the past month and there is something to be
> said for the instant nature of a local cookie store. (Yum!)

I'm completely sold on the DB vs. cookies. For one, cookies don't
follow the user around to multiple computers, which seems to be an
increasing trend especially among teens. Second, cookies have a
maximum size (4096 bytes - overhead) which can be easily exceeded by a
simple article.

The time it takes to save to the DB is completely irrelevant as I see
it, because the save will occur asynchronously, in the background, and
will never freeze the UI at all. If the user saves the post manually
before the autosave request hits the DB, great. There's no conflict
introduced by being too slow.

The wp_autosave plugin I originally wrote a year ago and can't find
used this exact method -- saving to a user option row in the DB and
prompting upon entry to the Write screen to restore a saved post. I'm
going to look around for it some more, because it was 95% done and
working.

--
Brad Fults
NeatBox


More information about the wp-hackers mailing list