![]()
Instead of
file = EEx.eval_file("lib/application.html.eex")
you might want to compile the template to a function
require EEx
EEx.function_from_file(:defp, :index_html, "lib/application.html.eex", [])
get "/" do
send_resp(conn, :ok, index_html())
end
it would help you avoid reevaluating the template on each request.
For distribution, there are several options worth exploring, you can go the “phoenix route” and make a basic pubsub or you can go “riak route” and use a hash ring to distribute chat processes across nodes. The former is simpler, the latter is less chatty.






















