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'; }