Phoenix.React.Cache (Phoenix.React v0.5.2)

View Source

Cache for React Component rendering

Cache key is a tuple of component, props and static flag

Remove expired cache every 60 seconds

Summary

Functions

Returns a specification to start this module under a supervisor.

Get a cached value

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete_cache(component, props, mod)

@spec delete_cache(
  Phoenix.React.component(),
  Phoenix.React.props(),
  :static_markup | :string
) :: true

Remove cached value

get(component, props, mod)

@spec get(Phoenix.React.component(), Phoenix.React.props(), :static_markup | :string) ::
  binary() | nil

Get a cached value

put(component, props, mod, result, opt \\ [])

@spec put(
  Phoenix.React.component(),
  Phoenix.React.props(),
  :static_markup | :string,
  binary(),
  [
    {:ttl, integer()}
  ]
) :: true

Set a cached value

start_link(_)