From 8506108aaa391a5bfd128b0ffb976c4f3b41b6e4 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 22 Jul 2013 18:20:26 +0200 Subject: [PATCH] Do not cache results for queries you can't fetch source tables of --- app/controllers/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/app.js b/app/controllers/app.js index 15d2a8af..d050435e 100755 --- a/app/controllers/app.js +++ b/app/controllers/app.js @@ -263,7 +263,7 @@ function handleQuery(req, res) { res.header('Cache-Control', 'public,max-age=' + ttl); res.header('X-Cache-Channel', ''); // forever } else { - if ( tableCacheItem.may_write ) { + if ( ! tableCacheItem || tableCacheItem.may_write ) { ttl = 0; } else { res.header('X-Cache-Channel', generateCacheKey(database, tableCacheItem, authenticated));