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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user