emerleite / tesla_cache

CacheX middleware for Elixir Tesla HTTP Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TeslaCache

Build Status Coverage Status codecov Module Version Hex Docs Total Download License Last Updated

TeslaCache is a Basic Cache Middleware for Tesla. It will cache only GET requests for X milliseconds.

Installation

Add :tesla_cache to your list of dependencies in mix.exs:

def deps do
  [
    {:tesla_cache, "~> 1.1.0"}
  ]
end

Usage

defmodule GoogleClient do
  use Tesla

  plug Tesla.Middleware.Cache, ttl: :timer.seconds(2)
end

License

The source code is under the MIT License. Copyright (c) 2017- Emerson Macedo.

About

CacheX middleware for Elixir Tesla HTTP Client

License:MIT License


Languages

Language:Elixir 100.0%