Maintenance mode and Cache-only mode

Forum Avatar
Web & Mobile Team
#1 - Aug. 12, 2012, 12:44 a.m.
Blizzard Post
Since there are a few issues in KR/TW that are currently being looked at, this is good time let everyone know about two features: maintenance mode and cache-only mode.

We have the ability to put the API into a state where it can reject requests outright because of service maintenance or fill them only if the requested data is cached. This gives us a lot of flexibility behind the scenes to update the system and reduce service disruption.

When either of these modes are enabled, you'll get one of the following responses:

{
"code": "MAINTENANCE",
"reason": "The application is in maintenance."
}


{
"code": "LIMITED",
"reason": "The application is in limited mode."
}


When you receive one of these, we recomend that you apply some sort of back-off logic to reduce load the system. These modes are not enabled automatically (for now, maybe), so when they are enabled, it means we have explicitly decided to do so.
Forum Avatar
Web & Mobile Team
#3 - Aug. 12, 2012, 4:40 p.m.
Blizzard Post
Does the "code" key replaces the "status" key for every failed Diabki/World of Warcraft API request?

And I have to thank you, this allows way better tracking/handling of errors.

Edit: What is the HTTP status codes that will be returned?


At this time, I believe a 200 is returned. For maintenance we should and will return a 503. For cache-only we should and will return a 404.
Forum Avatar
Web & Mobile Team
#4 - Aug. 12, 2012, 4:53 p.m.
Blizzard Post
I suppose that I can take this time to explain some of the inner workings of the caching system and how it relates to the API.

The elements that compose a career profile include: account information (fallen heroes, artisan info, etc), account details (kills and account stats, etc), play time stats, hero list, hero information (name, class, level, equipped items, quests, etc), hero details (kills, etc) and item details. We also have a bunch of translation tuples for things like translating your battletag to a game account id.

Very frequently, we get game session events from the game team and we use those events to expire a really big cache (with many gigs of memory). When we expire cached data, we remove all of if from the cache and then explicitly re-fetch it all from our data source and put it back into the cache. This system works pretty well and allows us to proactively have data available by the time you end your game session and visit the D3 game site or a fansite.
Forum Avatar
Web & Mobile Team
#11 - Aug. 20, 2012, 3:21 a.m.
Blizzard Post
Just to confirm, you should be getting a 404 for invalid career and hero urls. It looks like there is a bug where the "LIMITED" error code is returned instead. I'll bring it up when I get back to the office.

An example URL that should 404 would be:

http://us.battle.net/api/d3/profile/Straton-1/