Skip to content

Latest commit

 

History

History
68 lines (38 loc) · 2.05 KB

elli_cache.md

File metadata and controls

68 lines (38 loc) · 2.05 KB

Module elli_cache

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).

Data Types


config() = [{mod, Mod::module()}]

Function Index

get_modified/2Maybe get the last modified date for a request.
get_size/2Maybe get the size of the response to a request.

Function Details

get_modified/2


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/2


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.