Skip to content

FAQ: Cache times, in game interactions, and busting the cache

Vendal Thornheart edited this page Jun 18, 2018 · 1 revision

API Caching and how it may affect you:

When your user is performing actions in-game while using your app, you may notice that there is a significant (up to 30 second) lag time between those in-game interactions and your app seeing those changes.

This is because the API has a cache on character data that can last for up to 30 seconds, and more importantly our API infrastructure currently has no ability to be proactively notified by game servers about when a character's state has changed: as a result, there's nothing telling us to "bust" the cache and provide you new data on the next request when an action is initiated entirely in game.

Workarounds

  • Recommended: warn your users that there may be a lag between what you see in the app and what you do in game.

Warning your users will be the best way to "play nice" with our API and let us retain caching.

  • If absolutely necessary for your use cases: bust our cache

If you are concerned about this caching for your use cases, there is a workaround. We would ask that you don't use it unless you are making an application that relies on accurate inventory state (such as an inventory manager), but if you find yourself in this scenario you can bust our cache by performing any successful write action. Any item equip, transfer, lock state change, etc... will cause us to toss out the currently cached copy of character data on your next fetch.

Looking to the Future

We will continue to look into ways to improve this experience, but for now this workaround may be useful for those of you who need highly accurate state information.