From 36f60d5bce9bac735b2f6d53f5ace582b2fd0f97 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 31 Mar 2015 10:07:39 +0100 Subject: [PATCH] enforce minimum size of 1k for compression --- services/document-updater/app/coffee/ZipManager.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/document-updater/app/coffee/ZipManager.coffee b/services/document-updater/app/coffee/ZipManager.coffee index 6011fee659..18482a5c69 100644 --- a/services/document-updater/app/coffee/ZipManager.coffee +++ b/services/document-updater/app/coffee/ZipManager.coffee @@ -60,7 +60,8 @@ module.exports = ZipManager = callback(null, result) compressIfNeeded: (doc_id, text, callback) -> - if ZIP_WRITES_ENABLED && ZIP_MINSIZE > 0 and text.length > ZIP_MINSIZE + if ZIP_WRITES_ENABLED and ZIP_MINSIZE > 1024 and text.length > ZIP_MINSIZE + # N.B. skip files of 1k or less, because gzip increases the size zlib.gzip text, (err, buf) -> if err? logger.err doc_id:doc_id, err:err, "error compressing doc"