From 22039fcf91daacaa2fb12eb64afa15d8896bbcd7 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Mon, 16 Nov 2020 00:16:41 +0100 Subject: [PATCH] caching_middleware: fix gzip compression not triggered --- src/node/utils/caching_middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/caching_middleware.js b/src/node/utils/caching_middleware.js index bc387ca2c..eaa87660a 100644 --- a/src/node/utils/caching_middleware.js +++ b/src/node/utils/caching_middleware.js @@ -196,7 +196,7 @@ CachingMiddleware.prototype = new function () { var statusCode = responseCache[cacheKey].statusCode; var pathStr = CACHE_DIR + 'minified_' + cacheKey; - if (supportsGzip && (headers['content-type'] || '').match(/^text\//)) { + if (supportsGzip && (headers['content-type'] || '').match(/^application\/javascript/)) { pathStr = pathStr + '.gz'; headers['content-encoding'] = 'gzip'; }