design patterns - Use Local Storage as an autosave proxy - good or bad? -
we developing web app uses auto save save pattern. feature came quite unexpected ui problems.
in order enhance user understanding of concept, wanted make autosave instant, not periodic visual feedback everytime document saved.
we thought using local storage temporary data cache, , set slower interval synchronizes user data web server in background. might have bad side-effects when dealing possible revision conflict scenarios.
has had experience autosave patterns and/or using local storage data proxy, , can share valuable information
i assume instant mean after every user edit action (or keypress or whatever)? depends on data have here. if have text documents see no reason why not directly interact server add sleep time example:
if user edits set switch edited = true, if last commit longer 10 seconsd ago, commit current state (the document may have changed in time, use current state) set last commit switch current time.
i think local buffer complicated , brings more pain useful.
however if decide common way fill buffer @ higher frequency (but using method described above), , let transmit server @ lower frequency (also using methods above). timestamp/incrementid passed first second third buffer etc. when restoring content buffers or storage servesr fetched , latest version (with increment id first buffer) used.
Comments
Post a Comment