RemotePersistentTerm.Fetcher.Http.Cache (RemotePersistentTerm v0.8.1)

View Source

A module to assist in following the HTTP Caching spec.

See more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching

Summary

Functions

Calculates the refresh interval from the cache-control and age headers. Caching directives are case-insensitive. Multiple directives are permitted and must be comma-separated.

Functions

refresh_interval(resp)

@spec refresh_interval(Req.Response.t()) ::
  {:ok, pos_integer()} | {:error, String.t()}

Calculates the refresh interval from the cache-control and age headers. Caching directives are case-insensitive. Multiple directives are permitted and must be comma-separated.

Refresh interval is in milliseconds.