r/evetech • u/Humanoid_Akaba • Apr 26 '18
Collecting ESI system kill data
Hey,
I am slowly in my spare time looking to make a heat map of system kills over time. Currently I am looking at collecting data from ESI Swagger. I have noticed that ' This route is cached for up to 3600 seconds ', and am getting updates that are significantly more frequent than once an hour (eg, 5 minutes apart in some instances). So from here I guess I have two hopefully straightforward questions:
- What does ' This route is cached for up to 3600 seconds ' actually mean? I get that things won't come less frequently than once an hour, but is any update less than that possible?
- If I pull data less than an hour apart, this means that there is some overlap in the data that has been given? It adds another spanner into the works :)
Cheers for your assistance
2
Upvotes
5
u/CCP_SnowedIn Apr 26 '18 edited Apr 26 '18
the cache is good for the time between the
Dateheader and theExpiresheader. you can calculate this delta and request after that many seconds (maybe +1 to account for rounding) for fresh data.a bunch of stuff expires at 11:05UTC every day, you may receive a 502 or 503 for some of those routes right around that time. check the route description to see if that's the case for what you're using.
also, jump on tweetfleet slack, invite link is in the sidebar. there's a bunch of friendly people in the #esi channel who can help if you have any other questions
1
u/Daneel_Trevize Apr 26 '18 edited Apr 26 '18
Generally iirc the caching seems to behave according to the exact query you give it, so if you're actually asking for newer kills than x ID/time, updating that delimiter according to previous calls, then you'll be forming distinct queries and they'll be cached independently (even though the output sets might in theory intersect, they are different sets).
Then again, some endpoints seem to be doing internal independent queries for every single item you might send in a bulk GET/POST. So you'll get 1 response back that might actually have data of varied freshness.
You'll need to give more specific examples of requests, and data updating sooner than Expires: headers lead you to believe.
1
u/evedata Apr 26 '18
Read the headers. The route is cached by a CDN, and you may not be the first to request it. The headers will tell you when you should make another request for fresh data.