# `Macaw.Live.Proxy.Cache.Memory`
[🔗](https://github.com/dcoai/macaw_live/blob/v0.1.0/lib/macaw/live/proxy/cache/memory.ex#L1)

The proxy's default cache (spec/06 §1.5): an ETS table its process owns, started under
the host's `Macaw.Live.Supervisor` as `<live>.ProxyCache`, so the table is the
supervisor's. It holds at most `entries:` answers (10,000) and `bytes:` bytes of bodies
(256 MiB), dropping the least recently used past either; a body larger than `bytes:` is
never held. Reads go to the table directly and tell the process what was used; writes
go through the process. A stale entry is a miss, and dropped.

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

Its child spec: `name:` (required, the table's name too), `entries:` and `bytes:`.

# `start_link`

```elixir
@spec start_link(keyword()) ::
  GenServer.on_start() | {:error, [Macaw.Base.Fault.t(), ...]}
```

Starts the cache: `name:`, an atom, required; `entries:` (10,000) and `bytes:`
(268,435,456), positive integers. `{:ok, pid}`, or `{:error, faults}`: `{[:name],
:required}`, `{[key], {:type, :pos_integer}}`.

---

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