I need to verify what data wasn't downloaded yet. For example, how does Twitter or Facebook verify if a specific client has already dowloaded a piece of information?

When a mobile app like twitter make a request to twitter.com will receive only new data but not data that it has already downloaded in old requests.

  • 3
    -1 very vague question.
    – DMin
    Jun 23, 2011 at 8:09
  • Di Motta: Please don't explain more in a comment. Please update the question to explain more. After you update the question, please delete the comment.
    – S.Lott
    Jun 23, 2011 at 9:53

3 Answers 3


It depends on the precise requirement.

For something like Facebook / Twitter where it's not the end of the world if something gets returned twice the simplest mechanism would be to store a last successful download timestamp against each user/client and only return data more recent than that point.

If you need a guarantee that each item has been delivered and delivered only once (for instance for financial transactions) then the solution will likely be more complex and involve a series of calls - the client requesting data, the server returning the data, the client confirming that it has received and processed the data and the server acknowledging that. In that case I'd also be inclined to mark each record as downloaded individually rather than rely on a timestamp.

You also need to think about whether you're dealing with single or multiple clients and store the timestamp or whatever appropriately (that is against each client instance rather than each user) and make sure you have a mechanism for accurately identifying each client.


I hardly understand your question. What do you mean by information? Is it a file, a page, an abstract piece of data? What do you mean by client? Is it a browser, a computer identified by an IP, a registered customer?

The case of the registered customer is the easiest one. When downloading a file or loading a page or whatsoever, you can save a record in a table, saying that the customer A have requested the piece of data B. There are some nuances, especially with files download, but I'll not bother you with the details, especially since it's off-topic and would be more appropriate on StackOverflow.

If on the other hand you want to track downloads from the same machine, you can do it by identifying it through the IP address. This has some difficulties too: the same person using the same device can change IP even during the same session, or multiple devices can share the same IP address (like two computers of the same company connected through the same router).

Finally, you can track the client through the cookies. This has two weaknesses: the person can at any moment delete or change the cookie (and somebody else can use the same cookie), and if the person changes the browser, cookies will be lost.

Depending on your precise problem, you can choose one, two or all three types of tracking to be able to know more or less who downloaded what.

  • Hi, I am interested in the client-server communication in particular I need to provide a service that returns data only once for a client.
    – ADIMO
    Jun 23, 2011 at 8:20

If you keep track of every change to the data, you can use a checksum (like SHA-1 in Git or MD5 in rsync) to quickly determine where to start the next download from. If you don't keep track of atomic changes, you can instead ask when the last download happened. The best practice here is simply to

  • request the smallest piece of information possible to identify what has been downloaded, and
  • respect privacy. Authentication should happen elsewhere, if necessary.

Not the answer you're looking for? Browse other questions tagged or ask your own question.