代理每个服务器调用以解决API限制(即Twitter)是否合理?

时间:2021-03-13 03:48:40

I've run into a few problems with API limits(too many calls) and server timeouts(calls too fast) while coding an AIR App.

在编写AIR App时,我遇到了一些API限制(太多调用)和服务器超时(调用太快)的问题。

I'm not very familiar with the performance of proxies, so I'm wondering if downloading a list of proxies to the app every so often and using a different proxy for every API call would be reasonably fast. I'm not even sure where to get an updated list of proxies, so any insight would help.

我不是很熟悉代理的性能,所以我想知道是否每隔一段时间就向应用程序下载一个代理列表,并且每个API调用使用不同的代理都会相当快。我甚至不确定从何处获取更新的代理列表,因此任何洞察都会有所帮助。

Feel free to suggest other, alternative solutions. Thanks!

随意提出其他替代解决方案。谢谢!

1 个解决方案

#1


By going the proxy route you are effectively making every one of your users violate Twitters TOS. That is a bad, bad idea.

通过代理路由,您实际上会使每个用户违反Twitters TOS。这是一个糟糕的坏主意。

What I would suggest is:

我建议的是:

  • Allow the client to set the interval
  • 允许客户端设置间隔

  • Refresh / fetch your data in another thread that obeys the client's interval
  • 在服从客户端间隔的另一个线程中刷新/获取数据

  • Let your users configure a SOCKS proxy, or their own favorite HTTP proxy
  • 让您的用户配置SOCKS代理或他们自己喜欢的HTTP代理

At that point, it is them, not you who (might) annoy twitter.

在那一刻,是他们,而不是你(可能)惹恼twitter。

Still, give some thought to the tenability of your app, if it needs to make requests so quickly in order to be usable. The last thing you want is someone saying "I downloaded footwit and now I'm banned from twitter! I had to pay $10 to get a new IP from my ISP, then I found out that Twitter banned the entire /20 !!"

尽管如此,如果需要如此快速地提出请求以便可用,请考虑一下应用程序的可用性。你想要的最后一件事就是有人说“我下载了自己的脚and现在我被禁止上传了!我不得不花10美元从我的ISP那里获得新的IP,然后我发现Twitter禁止整个/ 20 !!”

Think, think, think.

思考,思考,思考。

#1


By going the proxy route you are effectively making every one of your users violate Twitters TOS. That is a bad, bad idea.

通过代理路由,您实际上会使每个用户违反Twitters TOS。这是一个糟糕的坏主意。

What I would suggest is:

我建议的是:

  • Allow the client to set the interval
  • 允许客户端设置间隔

  • Refresh / fetch your data in another thread that obeys the client's interval
  • 在服从客户端间隔的另一个线程中刷新/获取数据

  • Let your users configure a SOCKS proxy, or their own favorite HTTP proxy
  • 让您的用户配置SOCKS代理或他们自己喜欢的HTTP代理

At that point, it is them, not you who (might) annoy twitter.

在那一刻,是他们,而不是你(可能)惹恼twitter。

Still, give some thought to the tenability of your app, if it needs to make requests so quickly in order to be usable. The last thing you want is someone saying "I downloaded footwit and now I'm banned from twitter! I had to pay $10 to get a new IP from my ISP, then I found out that Twitter banned the entire /20 !!"

尽管如此,如果需要如此快速地提出请求以便可用,请考虑一下应用程序的可用性。你想要的最后一件事就是有人说“我下载了自己的脚and现在我被禁止上传了!我不得不花10美元从我的ISP那里获得新的IP,然后我发现Twitter禁止整个/ 20 !!”

Think, think, think.

思考,思考,思考。