[英]Github API rate limit on public Github Pages Site
I've setup a github pages site here: http://d3js.live 我在这里设置了一个github页面网站: http : //d3js.live
This uses the github api to get gists for d3.js examples. 这使用github api获取d3.js示例的要点。 The end look and functionality is similar to this site: http://threejs.live 最终外观和功能类似于此站点: http : //threejs.live
I'm getting a 403 error due to my rate limit being hit. 由于我的速率限制被击中,我收到403错误。 I understand that authenticating will increase my rate limit, however I'd like this site to be public. 我知道验证会增加我的速率限制,但我希望这个网站是公开的。 Because of this, I have a few questions: 因此,我有几个问题:
Mike Bostock's bl.ocks seems to get around the rate limit but it's not clear to me how this is done. Mike Bostock的bl.ocks似乎已经达到了速度限制,但我不清楚这是如何完成的。
The best way to get around the limit is to write a simple back-end that makes the API requests to GitHub (or whoever), cache those results for some time to remain below the rate limit, and then serve all the required assets from that request to your users. 绕过限制的最好方法是编写一个简单的后端,向GitHub(或任何人)发出API请求,将这些结果缓存一段时间以保持低于速率限制,然后从中提供所有必需的资产请求您的用户。
If your JavaScript is polymorphic, it should be fairly trivial to put most of what you already have in a NodeJS server. 如果您的JavaScript是多态的,那么将您已有的大部分内容放在NodeJS服务器中应该是相当简单的。
As a general rule, this is probably what a tool like this should do, anyway. 作为一般规则,这可能是这样的工具应该做的事情。 Of course, given the trade-off required, arguments could be made either way. 当然,鉴于需要权衡,可以采用任何一种方式进行论证。
This is what bl.ocks seems to do, for example. 例如,bl.ocks似乎就是这样做的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.