enonic/starter-pwa

Change background sync to use websockets instead of polling

Closed this issue · 1 comments

In order to fetch items from the repo on the "Background sync" page we poll the server (send a request every X seconds). We should use Websockets instead - whenever there are changes in the repo, they should be pushed down to the clients. Good example of websockets implementation can be found here: https://github.com/enonic/app-xphoot

Current polling is both slow and annoying, lets rewrite the bg-sync feature by using websockets instead.

Things to fix:

  • Websocket should not require login
  • When data is updated in the repo, it should be immediately pushed onto clients. Now it takes 3 seconds in firefox before the data is updated.