Rafael guinho
Rafael guinho

Reputation: 13

Best way to request synchronization when offline

I'm developing a web app that need work on-line and when the coonection is not available, so i would like to say how the best way to synchronization my requests when on-line again. I see some things about Service Workers, but i don't know if it is the best.

Upvotes: 0

Views: 57

Answers (1)

Marco Castelluccio
Marco Castelluccio

Reputation: 10802

You can definitely use service workers for this use case!

The particular solution will depend on your specific needs (service workers are pretty generic).

A possible approach would be a "request deferrer", like the one implemented in the ServiceWorker Cookbook. In this solution, while the user is offline, requests to the server are queued and, when the user goes back online, the queued requests are actually executed against the server.

Upvotes: 2

Related Questions