I want to load data from server via ajax only if data is changed on server. I'm using AngularJS and I need to implement this feature there.
So, for example, certain User has added/edited/deleted some item from application and this item was saved to db. Other users should get refreshed list of items.
I can add something like setInterval, for loading items from server, but this approach seems overkill.
I also can use something that can be implemented by Observer pattern. So I will be need to have the extra column in my db, that will set to true, if update was happened. And next I still need setInterval for load all data, that has updated flag.
Please, show me the best way for loading data via ajax only if data was changed on server and save me from inventing the wheel. (Maybe AngularJS has similar functionality?).
Any help will be appreciated!