Only gzip text files.
It is not very productive to compress images so compress text only.
This commit is contained in:
parent
aac849f6ea
commit
df9e29087f
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue