PlugCacheControl.Helpers (PlugCacheControl v1.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, overwriting the existing header value.

Link to this section Types

Link to this type

directive_opt()

@type 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)

This function is deprecated. Use `patch_cache_control/2` instead.
Link to this function

patch_cache_control(conn, directives)

@spec patch_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)

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

Serializes the cache control directives and sets them on the connection, overwriting the existing header value.