Currently under development is the site, using the Instagram API. The problem is that even at the initial stage we do not fall into the limit of 5000 requests per hour, from which the site stops working. What can be done to remove this limit or limit the number of requests?

  • Tell me, was able to contact instagram to increase the limits? - user11189
  • How does this answer the question? - VladD
  • 2
    @VladD such answers should be immediately translated into comments :) Otherwise, they also punish the person, but it's a pity. It seems like just interested. - lampa
  • @lampa: Yeah, and that's right, newbies need help :) - VladD

1 answer 1

Judging by the speed of the site, you redirect all requests directly to the API. It is completely useless.

Cache API responses for a while (matched / calculated from needs). Especially it makes sense to cache responses to the most frequent requests.

For example, “popular” can be cached for 15 minutes, “ratings” can be safely cached for several hours, and “photo of the day” for a day.

At the same time, it is possible to monitor the number of requests, and in the event of a shortfall (all 5000 requests per hour have not yet been selected), make additional requests to the API to update the information in the cache and update popular pages.

However, sooner or later, you will still end up in the limit. Consider using multiple keys or negotiate an increase in limits with instagram.