Preemptively getting pages with HTML5 offline manifest or just their data -
background
i have (glorified) crud application i'd enable html5 offline support with. cache-manifest system looks simple yet powerful, i'm curious how can allow users access data while offline.
for example, suppose have these pages entity "case" (i.e. crm case-management software):
http://myapplication.com/case http://myapplication.com/case/{id} http://myapplication.com/case/create
the first uri contains paged listing of cases, using querystring parameters pageindex
, pagesize
, e.g. /case?pageindex=2&pagesize=20
.
the second uri template editing individual cases, e.g. /case/1
or /case/56
.
finally, /case/create
form used create cases.
the problem
i 3 available offline.
/case
the simple way add /case
cache-manifest, break paging (as links wouldn't work).
i think instead add /case/alldata
xml resource, cached , if offline script on /case
use xml data populate list , provide pagination.
if go latter, how can have xml data stored in in-browser sql database instead of cached resource? think using sql database more resilient.
/case/{id}
this more complicated. there simple solution of manually adding /case/1
, /case/2
, /case/3
etc... /case/1234
, there can hundreds or thousands of cases isn't practical.
i think system should provide access 30 recent cases, example. above, how can store data in database?
also, how work? if don't explicitly add /case/34
manifest , user clicks on /case/34
how can browser load page javascript populate based on browser's sql database data , not display offline message?
/case/create
this 1 more simple - it's empty page , on <form>
's submit
action script detect if it's offline, , if offline add browser's sql database. sound okay?
thanks!
i think need looking @ localstorage database (though have downsides), there other alternatives such websql , indexeddb.
also don't think should using numeric id's if allowing people create primary key conflicts, best use guid.
another thing need ability push new cases onto server. there multiple...
can edited? if can think need thinking synchronization , conflict resolution hard hard if case.
shameless self promotion, have project designed handle these issues, though it's not done, it's close. can see (with ugly functional) demo @ https://github.com/forbesmyester/syncit
Comments
Post a Comment