Drifyt.2598:

Hi API Devs,

I’ve been experimenting with numerous AN API’s in a ‘live view’ sort of situation and was wondering if any you experienced api devs could give some feedback into item updates. Specifically, in your own experience, how often would you say an item changes? Is there anywhere that changes are noted? I would assume after each patch? I am unsure if items can change mid version.

I’m looking at ways to fine tune and optimize my calls to this interface so any hindsight would be greatly appreciated. My thinking is to cache the results locally and use these until the Cache-Control expires or the client and or server is patched.

Cheers
Paul

Eearslya.6309:

From what Lawton has said before, items are not supposed to change until an actual build. So you can check /v2/build every now and then until it increments, then you know to re-check your items. However, new items can appear between builds, so you can just check the /v2/items endpoint for the list of IDs and see if anything is new.

The Cache-Control header will almost always return a value of 5 minutes only, unless you’re dealing with trading post APIs, so that probably won’t help.

Lawton Campbell.8517:

Specifically, in your own experience, how often would you say an item changes? Is there anywhere that changes are noted? I would assume after each patch? I am unsure if items can change mid version.

To add to Eearslya’s response, items cannot change unless the value of /v2/build updates — that’s the only time that the dat-reading component (from which anything with localized data originates) pulls updated data. For endpoints that are localized, if /v2/build hasn’t changed since the last fetch, the same data will be returned.

It’s a bit annoying, but our API backend is totally stateless so there’s not a good way for the API to respond to If-Modified-Since requests (or respond with Last-Modified). This issue has been raised a few times in the past (and I opened a github issue today to track it better), but my current recommendation is to do a complete re-fetch of any data persisted by the application from localized endpoints whenever /v2/build updates. There might be a better way to do this in the future, but right now that’s the only recourse available for application developers to always have an up-to-date version of the data.