From df9e29087f92e3dca69311f46770cfd91a6fb0f7 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sun, 19 Feb 2012 20:11:52 -0800 Subject: [PATCH] Only gzip text files. It is not very productive to compress images so compress text only. --- node/utils/caching_middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/utils/caching_middleware.js b/node/utils/caching_middleware.js index e1d8677ea..809bb210f 100644 --- a/node/utils/caching_middleware.js +++ b/node/utils/caching_middleware.js @@ -146,7 +146,7 @@ CachingMiddleware.prototype = new function () { var statusCode = responseCache[cacheKey].statusCode; var pathStr = CACHE_DIR + 'minified_' + cacheKey; - if (supportsGzip) { + if (supportsGzip && (headers['content-type'] || '').match(/^text\//)) { pathStr = pathStr + '.gz'; headers['content-encoding'] = 'gzip'; }