Plug.PageCache v0.1.0 Plug.PageCache.Adapter behaviour

Cache adapter base server.

One incarnation of it will be started for every properly configured cache.

Summary

Callbacks

Cleans a cache by removing all entries

Tries to load a page from the cache by its full path

Removes a cache entry

Saves a page to the cache

Callbacks

clean(state)

Specs

clean(state :: Keyword.t) :: :ok

Cleans a cache by removing all entries.

load(state, path)

Specs

load(state :: Keyword.t, path :: String.t) ::
  String.t |
  nil

Tries to load a page from the cache by its full path.

remove(state, path)

Specs

remove(state :: Keyword.t, path :: String.t) :: :ok

Removes a cache entry.

save(state, path, page)

Specs

save(state :: Keyword.t, path :: String.t, page :: String.t) :: :ok

Saves a page to the cache.