So we run a site where there are elements of the interface that could potentially be changed at any moment in the backend. Specifically we run a web service where certain functions are loaded dynamically. However, there are times where we remove certian functions and we want the experience to be as seamless for the user as possible. Now we've considered a few methods of solving this

  1. Ping the server every few seconds. If the functions are outdated/no longer available refresh the users page. While this would work the best, I feel like having that much IO can't be too good

  2. When the user clicks a function, if it's outdated/no longer available, alert them in the response and refresh the page. This would also work fairly well.

I guess I'm more wondering how web apps like Google Docs work where you have content that has to be synced up across multiple users and that isn't more than a few seconds outdated

Sorry if this isn't the best place to ask this. I figured this was more of a site architecture question and that this might be the place to ask it over SO.

  • Websocket maybe? This question's more about the implementation of the web application and its user experience so here's probably not the place for it, but I think be on topic if you edit it to be specific to the server impacts of the different options. – Shane Madden Oct 29 '13 at 17:18
  • Google asks users to refresh the page as soon as it detects the current software is out of date, and will stop receiving any further updates. Putting the current version of the software on the header, or in the response should not too complicated. – Nican Oct 29 '13 at 19:27
  • I understand that. I guess my question was more about the best/most efficient (in terms of IO) way of detecting that the current software is out of date? You can either ping the server at a predetermined interval (1) or detect it and report when the user tries performing an action (2). – user1561753 Oct 29 '13 at 20:05
  • My vote is for missing method detection. Pinging is not going to work if in this moment the ping says the method is available, but in the next moment it isn't and the page tries to call it. – Robert Harvey Oct 29 '13 at 21:52

I generally dislike the notion of making things disappear suddenly. Makes me paranoid. So I would stick to the second option.

However, if you still want it to be somewhat like the first one, you should do pushing instead of polling. Check out this page.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy