Context
A mobile client web application (html/js) that makes PUT http requests to a tracking endpoint. The application is built on top of cordova, using vuejs vuex, superagent and localforage
Problem
When the client is offline the requests end up with a timeout and the information to transport is lost.
I think the next step is to cue the requests, my question is where does this logic belongs.
Explaining this same problem I've been told that this should be implemented on service workers, but reading about it I don't see any benefit from using that, since the client app does not rely on the response using things like a cached response won't solve my problem.
On the other end I think this could be achieved by storing on the device the cue of requests and delete once its sent successfully to the server.
Question
- Is there any recommendation, or good practice to follow regarding this problem?
- Should this be implemented on service workers or in the application itself?
- Are there any libraries that tackle this same problem?