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