Skip to content

Naive greedy cache for Faraday, (almost) no dependencies

Notifications You must be signed in to change notification settings

zverok/faraday_naive_cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Naive cache middleware for Faraday

Very naive. Such useful. Wow.

Usage:

require 'faraday'
require 'faraday/naive_cache'

connection = Faraday.new 'http://example.com/api' do |conn|
  conn.use Faraday::NaiveCache
  conn.adapter Faraday.default_adapter
end

conn.get 'some_endpoint' # real query

# and then...
conn.get 'some_endpoint' # get file from disc, stored in tmp/cache

TODO

  • Path settings;
  • Cache invalidation strategies;
  • Many other useful enchancements.

About

Naive greedy cache for Faraday, (almost) no dependencies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages