Question: **Issue**

Using REST, I populate a list onto a page. I want the page to refresh the list without refreshing the page whenever a new item is added to the list.

**Current Shoddy Solution**

I have 2 GET requests. 1 is to populate the list onto the page, the other is to check the ID of the TOP item. Request 2 runs every 5 sec using setInterval(). I then compare the IDs of the newest item and the last one posted on my page (embedded the ID into the ID tag and then retrieved). Using an IF, if the newest added item ID is not equal to the latest item on the page, I run GET request 1 again to populate the new data on the page.

This is working well from the end user's perspective and doesn't seem to be taxing resources too much but, I feel like running a GET request, even if it's lite, pulling the only top item and only the ID column, is still a GET request every 5 sec.

Is this acceptable and I'm worrying too much? Are there better ways to check if a new item has been added?

Answer: 
Hi why not take another approach and use SharePoint search + rest api inside our script? The SharePoint Search can deal with large information quantity and can do teh job for query. I´ve already have the same problem and solved with it
You could persist the last processed ID once per 5000 Bach and add it to the query as an additional filter. The ID is indexed OOTB so that should work...

Also you can try to retrieve the items with a broken permissions by retrieving all the security scopes from the DB (grrr... You said online - sorry - remove that)