Plug.CacheControl.Helpers (Plug.CacheControl v0.1.1)

Contains helper functions for working with cache-control header on Plug connections.

Link to this section Summary

Functions

Merges directives into the current value of the cache-control header.

Serializes the cache control directives and sets them on the connection.

Link to this section Types

Link to this type

directive_opt()

Specs

directive_opt() ::
  flag(flag_directive()) | delta(delta_directive()) | {:no_cache, String.t()}

Link to this section Functions

Link to this function

merge_cache_control(conn, directives)

Specs

merge_cache_control(Plug.Conn.t(), [directive_opt()]) :: Plug.Conn.t()

Merges directives into the current value of the cache-control header.

Link to this function

put_cache_control(conn, directives)

Specs

put_cache_control(Plug.Conn.t(), [directive_opt()]) :: Plug.Conn.t()

Serializes the cache control directives and sets them on the connection.