From 67f0ffb4da4aea8976605108855b68c7e9291d58 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 24 Aug 2012 05:57:26 -0400 Subject: [PATCH] minor changes --- config.json | 4 ++-- server.js | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/config.json b/config.json index 0de340e3..d58f0b2d 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { - "cache" : {"allowed" : true}, + "cache" : {"allowed" : false}, "minification" : { - "js" : true, + "js" : false, "css" : true, "html" : true, "img" : true diff --git a/server.js b/server.js index 673497c5..d97a7d70 100644 --- a/server.js +++ b/server.js @@ -389,14 +389,26 @@ CloudServer._controller=function(pReq, pRes) * and minimizing setted then minimize it */ else if(lName.indexOf('min') < 0 && - CloudFunc.checkExtension(lName, ['js','css','html']) && CloudServer.Minify) - CloudServer.Minify.optimize(lName, { - cache: true, - callback: function(pFileData){ - lReadFileFunc_f(undefined, pFileData, false); - } - }); + + var lMin_o = CloudServer.Config.minification; + var isAllowd_b = false; + if(CloudFunc.checkExtension(lName, 'js') && lMin_o.js) + isAllowd_b = true; + + else if(CloudFunc.checkExtension(lName, 'css') && lMin_o.css) + isAllowd_b = true; + + else if(CloudFunc.checkExtension(lName, 'html') && lMin_o.html) + isAllowd_b = true; + + if(isAllowd_b) + CloudServer.Minify.optimize(lName, { + cache: true, + callback: function(pFileData){ + lReadFileFunc_f(undefined, pFileData, false); + } + }); else Fs.readFile(lName, lReadFileFunc_f);