Since each event has an ID and events are ordered in the response, you only need to remember the ID of the first event in the previous response (not all of the events).
So, the way I would do it is:
Initial fetch:
- fetch all event pages (pages from 1 to 10)
- store the ETAG of the first page
- store the ID of the first event in the first page
Subsequent fetches:
- conditionally fetch first page of events with the stored ETAG
- if a 304 Not modified response is received, then there are no new events so terminate
- if a 200 OK response is received, then we have new events. Fetch pages from 1 to 10 sequentially until the first page that contains the event with the ID equal to the stored ID. All newly fetched events up until that event are new events and should be processed. So, the number of new events is discovered incrementally as the result of fetching all events up until the event you have seen before. And you are fetching only pages that you have to fetch, not more than that.
- store the ETAG of the first page
- store the ID of the first event in the first page
- wait for some time and then go to step 1