From b15c016e266457a60fccb68adf73b5581903f894 Mon Sep 17 00:00:00 2001 From: RMcVelia Date: Mon, 23 Oct 2023 16:25:24 +0100 Subject: [PATCH] Exclude file types from compression for aks --- config.ru | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.ru b/config.ru index 95f8f253d5..8d4d061176 100644 --- a/config.ru +++ b/config.ru @@ -5,7 +5,11 @@ require_relative 'config/environment' require 'prometheus/middleware/exporter' require_relative 'lib/rack/deflater_with_exclusions' -EXTENSIONS_TO_EXCLUDE = %w(.jpg .jpeg .png .gif .pdf).freeze +if ENV.has_key?("VCAP_APPLICATION") + EXTENSIONS_TO_EXCLUDE = %w(.jpg .jpeg .png .gif .pdf).freeze +else + EXTENSIONS_TO_EXCLUDE = %w(.jpg .jpeg .png .gif .pdf .jp2 .webp .svg .ttf).freeze +end use Rack::DeflaterWithExclusions, exclude: proc { |env| File.extname(env["PATH_INFO"]).in?(EXTENSIONS_TO_EXCLUDE)