Do not cache results for queries you can't fetch source tables of

This commit is contained in:
Sandro Santilli 2013-07-22 18:20:26 +02:00
parent 2ee9411889
commit 8506108aaa

View File

@ -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));