Absence of X-Cache-Channel will be enough for Varnish to skip caching

Do not override Cache-Control in this case, which means let the
clients or geographical proxies cache the response with usual TTL.
This commit is contained in:
Sandro Santilli
2013-03-13 12:01:35 +01:00
parent fcd6d55ba4
commit 402fc90e63
3 changed files with 1 additions and 8 deletions
-4
View File
@@ -70,10 +70,6 @@ module.exports = function(){
res.header('X-Cache-Channel', channel);
cb(null, channel);
} else {
// avoid caching this result
// (temptative, what Varnish does is out of our control)
res.header('Cache-Control', 'no-cache,no-store,max-age=0,must-revalidate');
res.header('Pragma', 'no-cache');
console.log('ERROR generating cache channel: ' + ( err.message ? err.message : err ));
// TODO: evaluate if we should bubble up the error instead
cb(null, 'ERROR');