From c1a903e32e782047acc3abc5bc630a0317ab4f8b Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sat, 10 Mar 2012 15:57:27 -0800 Subject: [PATCH] Correct ca91c0c4032658d428fadbb8f178fb52be3ac471. --- src/node/utils/caching_middleware.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node/utils/caching_middleware.js b/src/node/utils/caching_middleware.js index 9e62ee84..61be733a 100644 --- a/src/node/utils/caching_middleware.js +++ b/src/node/utils/caching_middleware.js @@ -23,8 +23,9 @@ var zlib = require('zlib'); var util = require('util'); var ROOT_DIR = path.normalize(__dirname + "/../"); -var CACHE_DIR = ROOT_DIR + '../var/'; -CACHE_DIR = path.existsSync(CACHE_DIR) || undefined; +var CACHE_DIR = path.normalize(ROOT_DIR + '../../var/'); +console.log(CACHE_DIR) +CACHE_DIR = path.existsSync(CACHE_DIR) ? CACHE_DIR : undefined; var responseCache = {}; @@ -38,7 +39,7 @@ function CachingMiddleware() { } CachingMiddleware.prototype = new function () { function handle(req, res, next) { - if (!(req.method == "GET" || req.method == "HEAD" || !CACHE_DIR)) { + if (!(req.method == "GET" || req.method == "HEAD") || !CACHE_DIR) { return next(undefined, req, res); }