Open jantech opened 8 months ago
Hi @jantech ,
Yes I do have some thoughts, and one day I will get around to implementing them. All of the above can be achieved with the service worker. At the moment, the service worker will respond with the latest cached page when offline, but it does this without applying any logic.
We can add some logic to the SW that takes a POST request and adds it to a queue for later processing. Then when the SW detects that the network is online again, it can send the requests to the server and update the client with delivery status.
This is easy to type up my ideas, but I'm aware that in the real world there are many scenarios that need to be covered, and I don't want to implement something half-baked.
I will revisit the to dos on this project in time, but at the moment I am too busy with paid projects to invest my time into things like this.
More reading: the fetch event can be intercepted whenever the browser makes a new network request. the actual Request object can be cached/queued, and then dealt with when the network status changes.
Hope the links help show you my plans. If you feel like contributing any changes, I'm happy to help guide you, but at the moment I can't commit any time to the project.
Thanks @g105b , for your reply.
Looking forward for the To Dos get implemented. will be waiting for the updates.
Thanks, Jagan
Would love to talk about ideas on the topic. We also need the offline support and we are trying to come up with a way.
Hi @jantech and @eren-cantemur - this is something that I'm currently working on. Catching the requests from a form while offline, so it can be sent to the server when back online.
Trying to keep it simple and generic so it can be applied to any project.
I'm currently working on another project but as soon as I get time I'll finish this idea off.
Hi,
Do you have plan for implementing below offline support features mentioned?
Thoughts and to dos:
Thanks