{"id":16019450,"url":"https://github.com/oldhammade/teslacacher","last_synced_at":"2025-03-17T16:30:39.193Z","repository":{"id":41610943,"uuid":"308664979","full_name":"OldhamMade/TeslaCacher","owner":"OldhamMade","description":"A caching middleware for Tesla, backed by Redix.","archived":false,"fork":false,"pushed_at":"2025-03-07T16:05:11.000Z","size":16,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T18:50:41.510Z","etag":null,"topics":["elixir","elixir-lang","elixir-library","tesla"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/tesla_cacher","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OldhamMade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-30T15:07:29.000Z","updated_at":"2020-11-10T12:02:19.000Z","dependencies_parsed_at":"2024-10-27T15:19:27.969Z","dependency_job_id":"51ebfcf6-b2e3-49ed-9003-2c3c0dfcb177","html_url":"https://github.com/OldhamMade/TeslaCacher","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"1cbf43ca7ed1b1ea16c723ac5e23f46db68eaa04"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OldhamMade%2FTeslaCacher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OldhamMade%2FTeslaCacher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OldhamMade%2FTeslaCacher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OldhamMade%2FTeslaCacher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OldhamMade","download_url":"https://codeload.github.com/OldhamMade/TeslaCacher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244068716,"owners_count":20392881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-lang","elixir-library","tesla"],"created_at":"2024-10-08T17:04:24.143Z","updated_at":"2025-03-17T16:30:38.791Z","avatar_url":"https://github.com/OldhamMade.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TeslaCacher\n\n\u003c!-- MDOC !--\u003e\n\n[![Build Status](https://travis-ci.org/OldhamMade/TeslaCacher.svg?branch=main)][TravisCI]\n[![Module Version](https://img.shields.io/hexpm/v/tesla_cacher.svg)](https://hex.pm/packages/tesla_cacher)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/tesla_cacher)\n[![Total Download](https://img.shields.io/hexpm/dt/tesla_cacher.svg)](https://hex.pm/packages/tesla_cacher)\n[![License](https://img.shields.io/hexpm/l/tesla_cacher.svg)](https://hex.pm/packages/tesla_cacher)\n[![Last Updated](https://img.shields.io/github/last-commit/OldhamMade/TeslaCacher.svg)](https://github.com/OldhamMade/TeslaCacher/commits/master)\n\n\nTeslaCacher is a Basic Cache Middleware for Tesla backed by\n[Redix][Redix]. It will cache `GET` requests for `N` milliseconds, if\ndefined, otherwise for the lifetime of the Redis session. Requests\nother than `GET` are **NOT** cached.\n\nNot to be confused with [TeslaCache][Teslacache], which is backed by\n[Cachex][Cachex].\n\n## Installation\n\nAdd `tesla_cacher` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:tesla_cacher, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Usage\n\nTeslaCacher does not manage Redix for you, you must start and monitor\nit yourself and provide the details to the plugin:\n\n```elixir\ndefmodule MyClient do\n  use Tesla\n\n  plug Tesla.Middleware.Cacher,\n    redix: :redix,\n    expiry: :timer.seconds(2),\n    timeout: :timer.seconds(5),\n    prefix: :tesla_cacher\nend\n```\n\n### Options\n\n`redix` -- [required] the connection handle for redix. Can be an\natom or a PID.\n\n`expiry` -- [optional] (integer or `:infinity`) the expire time, in\nmilliseconds. Default is `:infinity`.\n\n`timeout` -- [optional] (integer or `:infinity`) request timeout, in\nmilliseconds. Default is `5000`.\n\n`prefix` -- [optional] (atom or string) a prefix to be used for redis\nkeys. `|` (pipe) is used as a separator to avoid lookup conflicts with\ncommon redis key schemes. Default is `tesla_cacher`.\n\n\n\n[Redix]: https://hex.pm/packages/redix\n[Teslacache]: https://hex.pm/packages/tesla_cache\n[Cachex]: https://hex.pm/packages/cachex\n[TravisCI]: https://travis-ci.org/OldhamMade/TeslaCacher\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldhammade%2Fteslacacher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foldhammade%2Fteslacacher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldhammade%2Fteslacacher/lists"}