Блог пользователя adamantium

Автор adamantium, 8 лет назад, По-английски

I am working to make an website, in which I need to parse the Json data of codeforces. For that I am following the API documentation of codeforces. But here I am facing a problem. To get the data of upcoming contest I am sending request from my website using contest.list method. The problem is, it returns all the contests of codeforces. But I just need to get the contest list which phase value is BEFORE. By parsing the data of all the contest it's making my website slower. Is there any way to get the contest list which phase value is BEFORE efficiently ??

UPD: Problem solved. I kept a locale file containing the json data and set a fixed time (say 1 hour). Then I check when the file was last modified. If it is less than the fixed time then the program use the locale cached file. This is making my website faster.

  • Проголосовать: нравится
  • +21
  • Проголосовать: не нравится