PlugEtsCache v0.3.0 PlugEtsCache.Response View Source

This module contains the helper to cache a Plug response.

Example usage:

defmodule MyApp.SomeController do
  # use/import modules depending on your framework/lib

  import PlugEtsCache.Response, only: [cache_response: 1]

  def index(conn, _params) do
    render(conn, "index.txt", %{value: "cache"})
    |> cache_response
  end
end

Link to this section Summary

Link to this section Functions

Link to this function cache_response(conn, ttl) View Source