0

Sure a delay of about a minute is not much, but when you consider that if you post a question the API sees it immediately, and often something using the API is ahead of the stackoverflow site, then it looks more like a problem?

Is this by design or just feasible or something.

1
  • Correct the spelling "stackoverflwo". Commented Sep 23, 2010 at 7:51

1 Answer 1

1

You're seeing the interplay of caching between the sites and the API.

The short of it is, both SO and the API implement fairly aggressive cache policies. I won't go into SO here, for one its always changing, because it varies depending on the pages, and age of the content.

The API, more simply, caches every response for 1 minute. So, if two consumers are hitting the same route (with the same parameters) within 1 minute they'll get the same result, assuming the cache was empty when the first request was received*.

Consequently, its possible for a "result" to appear in the API immediately (if the cache is empty), or after a delay (if the cache is not). Whether or not a "result" appears to be in sync with the site depends on how the user visits the site (logged in or anonymous), and the page viewed (as noted before, the policy varies).

So, yeah, ultimately this is by design.

*Note that things get complicated when you start accounting for network latency, all of this discussion is from the server's perspective.

1
  • Thought it would be something like this, just found it a bit strange that the API was ahead of the sites and then behind the sites.
    – Jonathan.
    Commented Sep 19, 2010 at 8:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .