使用法拉第中间件缓存来自GitHub API的响应

时间:2014-01-14 19:50:29

标签: ruby caching github faraday

我试图在已加星标的回购中设置缓存,但我无法获得faraday_http_cache或faraday_middleway的响应缓存以与Octokit一起使用。

Octokit.middleware = Faraday::Builder.new do |builder|
  builder.use Faraday::HttpCache # won't cache the private responses
  builder.use FaradayMiddleware:Caching @cache # fails to cache silently when using Marshal for caching
  builder.use Octokit::Response::RaiseError
  builder.adapter Faraday.default_adapter
  # builder.response :logger
end

不知道在哪里转向缓存已加星标的回购广告。

1 个答案:

答案 0 :(得分:0)

您可以传递shared_cache: false,因此请点击builder.use :http_cache, shared_cache: false