The maximum number of requests to Instagram per hour has been exceeded. What to do?
If you see an error "The maximum number of requests to Instagram per hour has been exceeded" when you try to load the gallery it means that Instagram has blocked your server due to high amount of requests per hour (currently 200 requests per hour). This can happen when you have many galleries on your website and also if someone else on your server is sending requests to Instagram too (Instagram bot, for example).
If this issue repeats from time to time you can do the following optimizations to your galleries to lower the amount of requests to Instagram servers:
- Limit the number of photos/videos in the gallery. If you will limit total number of items in the gallery to 50 (for example) - this will significantly decrease amount of requests to Instagram.
- Adjust "Cache lifetime". The default value is 36000 seconds which is 10 hours. it means that once in 10 hours your gallery will be refreshed with new data from Instagram. If the Instagram accounts/hashtags that you use in your galleries updates every day, you can increase "Cache lifetime" to 24 hours.
- Combine "Cache lifetime" with other galleries. When you have the same "Cache lifetime" in all galleries on your website - it means that they will be updates in the same time. To avoid it you need to set different "Cache lifetime" on each gallery. The difference must be at least one hour. For example, you have 3 galleries - you can set 9, 12 and 14 hours of "Cache lifetime" to these galleries.
Instagram can block your server not for an hour, but permanently. If it happens there are two possible ways to solve this problem. First - is to move your website to another web hosting server. Second - to use a proxy server for Instagram requests. There are many companies that provide proxies for Instagram, for example: https://proxy-store.com/en/
You just purchase a proxy, set it's settings to the InGallery and that's it.