Skip to content

Commit

Permalink
DEV: ENV variable for brotli quality in assets:precompile rake task (d…
Browse files Browse the repository at this point in the history
…iscourse#26286)

Why this change?

This ENV allows the brotli compression quality to be configurable such
that one can opt for a higher/lower level of compression based on their
preferences.
  • Loading branch information
tgxworld authored Mar 21, 2024
1 parent 2d867aa commit 0aa9250
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ end

# different brotli versions use different parameters
def brotli_command(path, max_compress)
compression_quality = max_compress ? "11" : "6"
compression_quality =
max_compress ? "11" : (ENV["DISCOURSE_ASSETS_PRECOMPILE_DEFAULT_BROTLI_QUALITY"] || "6")
"brotli -f --quality=#{compression_quality} #{path} --output=#{path}.br"
end

Expand Down

0 comments on commit 0aa9250

Please sign in to comment.