elli_cache behaviour.
Copyright (c) 2016, elli-lib team
This module defines the elli_cache
behaviour.
Required callback functions: get_modified/2
, get_size/2
.
Authors: Eric Bailey (eric@ericb.me
) (web site: https://github.com/yurrriq
).
config() = [{mod, Mod::module()}]
get_modified/2 | Maybe get the last modified date for a request. |
get_size/2 | Maybe get the size of the response to a request. |
get_modified(Req::elli:req(), Args::config()) -> maybe_m:maybe(calendar:datetime())
Maybe get the last modified date for a request.
If {mod, Mod}
is present in Args
and Mod:get_modified/2
is exported,
return Mod:get_modified(Req, Args)
. Otherwise, return nothing
.
get_size(Req::elli:req(), Args::config()) -> maybe_m:maybe(non_neg_integer())
Maybe get the size of the response to a request.
If {mod, Mod}
is present in Args
and Mod:get_size/2
is exported,
return Mod:get_size(Req, Args)
. Otherwise, return nothing
.