These are chat archives for arenanet/api-cdi

29th
Sep 2018
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 16:02
Is there any reason to use https://api.guildwars2.com/v2/characters/<character>/inventory over https://api.guildwars2.com/v2/characters/<character> ?
yes it has a smaller size but ti dosent provide ye any cache info
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 21:46
Gah
Am I doing somethign seriously wrong?
Any request I do to https://api.guildwars2.com/v2/characters/<character>
Any request sets the date to now, grand, can work with that
But it sets teh expires to 5 min later, not when teh cache expires
Daniel Snider
@dsnider-anet
Sep 29 2018 22:13
Are you talking about the Expires header?
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:13
yeah
no way to see how long a cache lasts for?
(sorry for the wall of text above, its doing my head in)
Daniel Snider
@dsnider-anet
Sep 29 2018 22:14
I don't think so? I'm trying to remember how it works (I'm not at the office so I can't open up the code)
First, I don't think the expires header makes any guarantees about the actual resource's cache-time: https://tools.ietf.org/html/rfc7234#section-5.3
so it's not wrong per se

also: I think max-age from the cache-control header is supposed to supersede the Expires header:

If there is a Cache-Control header with the "max-age" or "s-maxage" directive in the response, the Expires header is ignored

Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:19
maybe now that ye are here I should roll backa bit
Daniel Snider
@dsnider-anet
Sep 29 2018 22:20
I think it's fairly typical to throw a nice round number into the max-age part of cache control instead of a precise number (since usually the server has no idea when the resource will invalidate anyway)
connection.execute("ROLLBACK");
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:21
is the cache for each request global: eg if gw2E requests that endpoint/account first it is cached then if I access it its served from that cache
Or is it cached for each client?
hehehehee
Daniel Snider
@dsnider-anet
Sep 29 2018 22:22
caching is controllable per endpoint, but I believe the vast majority is global
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:23
hmmm
so if Gw2E requests trhe data first and I (within teh 5 min cache time) request it is there any way to see when teh cache was first served?
Daniel Snider
@dsnider-anet
Sep 29 2018 22:25
I don't think so
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:27
thanks, this is going to be more complicated fun
Daniel Snider
@dsnider-anet
Sep 29 2018 22:28
np, glad I could give you the bad news help
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:29
creating a droprate calculator/tracker, so now I am going to have to get the user to verify the before and after
tis not a bad thing, just means I have to get a bit mroe creative
oh by any chance would adding magicFind to teh account/character endpoints be on a list stuck to the underside of the table?
and send sanity coffee Irish Coffee
Daniel Snider
@dsnider-anet
Sep 29 2018 22:35
I wonder if you could figure out the cache timing by slamming the endpoint until it flips over and recording the time
that might be worse for the servers than just handing out when the cache expires
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:36
technically, but that would nto be polite
Daniel Snider
@dsnider-anet
Sep 29 2018 22:38
I see it mentioned here: arenanet/api-cdi#382
I'll take a look to see the feasibility of adding magic find on Monday
Silver Golden
@Silveress_Golden_gitlab
Sep 29 2018 22:42
thank you, sorry to be digging into yer saturday?
(no ?)