From 8e818da6513fcf90c92af9afd1e50dcf4f4c7c26 Mon Sep 17 00:00:00 2001 From: jamey Date: Sat, 21 Feb 2026 08:56:51 +0000 Subject: [PATCH] only enable gzip static file serving in prod Avoids stale .gz files from mix assets.deploy shadowing freshly-built dev assets. This was causing the admin to render with old DaisyUI dark theme CSS even after the unified theme migration. Co-Authored-By: Claude Opus 4.6 --- lib/berrypod_web/endpoint.ex | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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,