The easiest and most efficient is to maintain a cookie with a last_updated
value.
Use this value as either from_date
or min
, depending on the query, and simply pull those records, scan for matching data, and update the cookie date.
Combine this with some sort of session cache and it may serve the case but does not provide any history.
If you add persistent storage to the equation, it is simple enough to store the last_updated
in a user-specific store that maintains the records you have previously pulled and provides a reference from which to pull only new records.
While I typically shy away from technologies that are very platform/vendor specific - some of the database features being introduces in HTML5 are fairly compelling.
But, to answer the question, again:
The keystone to providing this type of feature is a reference date with which to pull records from which to extract either the data itself or the relevant post ids.
With a pagesize of 100 and all bool params (body, answers, comments) set, you should be able to update any non-skeetish user with any and all responses they have received with just a handful of queries.