Veil v0.2.4 Veil.Cache View Source

A cache to store sessions, to reduce database calls

Link to this section Summary

Functions

Touch to reset the expiry, then get

Fetches the value under the given key from the cache. If it doesn’t exist, calls function on key, stores it in the cache and returns it

If the changeset provided is valid, saves it in the cache under it’s identifier, and executes the repo function

Link to this section Functions

Link to this function get_and_refresh(cache, key) View Source

Touch to reset the expiry, then get

Link to this function get_or_update(cache, key, function) View Source

Fetches the value under the given key from the cache. If it doesn’t exist, calls function on key, stores it in the cache and returns it

Link to this function put(changeset, cache, repo_function, identifier \\ &(&1.id)) View Source

If the changeset provided is valid, saves it in the cache under it’s identifier, and executes the repo function