Only gzip text files.

It is not very productive to compress images so compress text only.
pull/468/head
Chad Weider 2012-02-19 20:11:52 -08:00
parent aac849f6ea
commit df9e29087f
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ CachingMiddleware.prototype = new function () {
var statusCode = responseCache[cacheKey].statusCode; var statusCode = responseCache[cacheKey].statusCode;
var pathStr = CACHE_DIR + 'minified_' + cacheKey; var pathStr = CACHE_DIR + 'minified_' + cacheKey;
if (supportsGzip) { if (supportsGzip && (headers['content-type'] || '').match(/^text\//)) {
pathStr = pathStr + '.gz'; pathStr = pathStr + '.gz';
headers['content-encoding'] = 'gzip'; headers['content-encoding'] = 'gzip';
} }