team match update delay

Sort:
edpratomo

hi... i noticed that a team match score has updated on the website, but the JSON returned is still the old score. it seems there is some delay there, how long is it? 

 

edpratomo

i can see it is cached for about 7 hours 20 minutes or so

< Last-Modified: Monday, 19-Feb-2018 01:24:09 GMT+0000 < Access-Control-Allow-Origin: * < X-Chesscom-Matched: pubapi_match < Cache-Control: public, max-age=5 < Expires: Mon, 19 Feb 2018 08:44:11 GMT

andreamorandini

@edpratomo We have analyzed the problem and it seems to be related to the fact that some of the match users are still on Chess V2. This can lead to Team Matches caches not be refreshed. 

 

About your question on cache expiration. To simplify a little we have two levels of caching, one in the server and the other in the CDN. We must instruct the CDN on which frequency it should check if the server cache has changed, and by default this time is "5 seconds".   

 

So when requesting and endpoint you will usually see:

 

< date: Mon, 19 Feb 2018 17:50:36 GMT  <-- date of request
< cache-control: public, max-age=5 <-- 5 seconds is the expiration time
< expires: Mon, 19 Feb 2018 17:50:41 GMT <-- CDN cache expires in 5 seconds

 

But when the server cache expires? It depends on the endpoints, in the case of team matches when the cache is 24h old OR the status of the team match changes (the match starts, scores are updated, the match ends, etc.). So we can say that the cache lasts at most 24h but, if everything works as expected, it will be refreshed much quicker if needed.

 

 

 

bcurtis

Another way to look at it: the API request and response is cached for 5 seconds (therefore, always five seconds after you made the request), but the data is cached on our server until it changes. Only very rarely do you need to be aware of the data cache; certain endpoints may have data that is up to 24h "stale" and these are all noted in the documentation. They are all cases where we aggregate the actions of many players, such as the Country or Club member listings.

edpratomo

hi... it seems that the issue is finally resolved. thank you. 

andreamorandini

@edpratomo thank you for your feedback and patience. We deployed a patch yesterday but we were still testing that everything was working as expected.

bcurtis
Montifeltro wrote:

Just for your information, the team matches update delay is not solved yet...

 

Can you supply a URL so that we can see the problem and work on tests to detect it?