From 9fe3830e7cd66257613aa301bee777f6e664346e Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 17 Jul 2025 17:46:29 +0100 Subject: [PATCH] Enable gzip in prod --- lib/music_library_web/endpoint.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/music_library_web/endpoint.ex b/lib/music_library_web/endpoint.ex index 2da38fb6..b4391192 100644 --- a/lib/music_library_web/endpoint.ex +++ b/lib/music_library_web/endpoint.ex @@ -21,12 +21,13 @@ defmodule MusicLibraryWeb.Endpoint do # Serve at "/" the static files from "priv/static" directory. # - # You should set gzip to true if you are running phx.digest - # when deploying your static files in production. + # When code reloading is disabled (e.g., in production), + # the `gzip` option is enabled to serve compressed + # static files generated by running `phx.digest`. plug Plug.Static, at: "/", from: :music_library, - gzip: false, + gzip: not code_reloading?, only: MusicLibraryWeb.static_paths() if Code.ensure_loaded?(Tidewave) do