# `ExFPL.Cache`
[🔗](https://github.com/sgerrand/ex_fpl/blob/main/lib/ex_fpl/cache.ex#L1)

ETS-backed cache with per-entry TTL.

Used by `ExFPL.Bootstrap.fetch/1` to avoid re-downloading the ~1 MB
`bootstrap-static` payload on every call. Started under the application
supervisor; the underlying ETS table is always available while the
application is running.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get`

```elixir
@spec get(term()) :: {:ok, term()} | :miss
```

Fetch a value from the cache. Returns `{:ok, value}` or `:miss`.

# `invalidate`

```elixir
@spec invalidate(term() | :all) :: :ok
```

Remove a single key, or all entries when called with `:all` (default).

# `put`

```elixir
@spec put(term(), term(), non_neg_integer()) :: :ok
```

Insert a value with an optional TTL in milliseconds (default 1 hour).

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
