[wp-trac] [WordPress Trac] #23220: Extend autosave to use the browser's local storage in addition to saving to the server

WordPress Trac noreply at wordpress.org
Sat Jan 19 18:21:55 UTC 2013


#23220: Extend autosave to use the browser's local storage in addition to saving to
the server
----------------------------+------------------
 Reporter:  azaozz          |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  3.6
Component:  Autosave        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  autosave-redo   |
----------------------------+------------------

Comment (by azaozz):

 Replying to [comment:5 F J Kaiser]:
 > That wouldn't be the only concern we should have...

 Yes, this is one of the weaknesses of the current implementation of
 `localStorage` in the browsers: there is no way to check how much storage
 is available. On top of that there is no easy way (Firefox) or no way at
 all (WebKit, IE) for the user to allocate more space. Only Opera pops up a
 dialog when the storage is full and lets the user make it "unlimited".

 The way around this would be to remove a revision when adding new revision
 fails. For example, if we decide to store 5 revisions, saving another
 revision would remove the oldest before attempting to add the newest. If
 adding the newest fails, we can try removing the next oldest to free some
 space, etc.

 > ... The best would be to have it _deadsimple_ and 3-function
 (get/set/dump) API wrapped around.

 I'm not even sure we need an API, `localStorage` is super simple to work
 with. The only thing an API could add would be to do JSON encoding and
 decoding of the values (see the script linked in @wonderboymusic's
 comment).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23220#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list