【问题标题】:Using Faraday Middleware to cache responses from the GitHub API使用 Faraday Middleware 缓存来自 GitHub API 的响应
【发布时间】:2014-01-14 19:50:29
【问题描述】:

我正在尝试在已加星标的存储库上设置缓存,但我无法让 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

不确定到哪里去缓存加星标的存储库。

【问题讨论】:

    标签: ruby caching github faraday


    【解决方案1】:

    你可以通过shared_cache: false,所以请改成builder.use :http_cache, shared_cache: false

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-21
      • 2017-12-29
      • 1970-01-01
      • 2011-01-27
      • 1970-01-01
      • 2020-01-13
      • 2017-01-23
      • 2019-09-05
      相关资源
      最近更新 更多