diff --git a/lib/berrypod_web/endpoint.ex b/lib/berrypod_web/endpoint.ex index 102a008..3ab7e07 100644 --- a/lib/berrypod_web/endpoint.ex +++ b/lib/berrypod_web/endpoint.ex @@ -16,14 +16,12 @@ defmodule BerrypodWeb.Endpoint do longpoll: [connect_info: [session: @session_options]] # Serve at "/" the static files from "priv/static" directory. - # gzip is always enabled — Plug.Static serves .gz files when they exist - # (created by `mix phx.digest`), falls back to uncompressed otherwise. - # In prod, digested filenames change per deploy so immutable caching is safe. - # In dev, we omit the option to get the Plug.Static default ("public"). + # gzip only in prod — avoids stale .gz files from mix assets.deploy + # shadowing freshly-built dev assets. plug Plug.Static, at: "/", from: :berrypod, - gzip: true, + gzip: Application.compile_env(:berrypod, :env) == :prod, only: BerrypodWeb.static_paths(), cache_control_for_etags: if(Application.compile_env(:berrypod, :env) == :prod,