ImagePipe.Source.Origin (image_pipe v0.1.0)

Copy Markdown View Source

Origin cache evidence, kept separately from the source's byte identity.

Validators are used only for upstream conditional requests. A weak origin ETag never becomes a strong representation ETag. Request header values and the effective resource URL are digested; raw credentials are not retained.

Summary

Functions

Evaluates current host policy against retained origin evidence.

Checks origin Vary against effective outbound request headers.

Returns origin validators, preferring ETag to Last-Modified.

Types

t()

@type t() :: %ImagePipe.Source.Origin{
  headers: %{required(String.t()) => [String.t()]},
  received_at: integer(),
  requested_at: integer(),
  resource: binary(),
  status: integer(),
  vary: %{required(String.t()) => binary()}
}

Functions

cache_state(origin, policy, stable?)

Evaluates current host policy against retained origin evidence.

matches?(origin, request_headers)

Checks origin Vary against effective outbound request headers.

validator_headers(origin)

Returns origin validators, preferring ETag to Last-Modified.