Improve readability
This commit is contained in:
parent
5ca498d0f3
commit
ec0c0eb810
@ -25,9 +25,9 @@ module.exports = function setCacheControlHeader ({
|
||||
const directives = [ 'public' ];
|
||||
|
||||
if (everyAffectedTablesCanBeInvalidated(affectedTables)) {
|
||||
directives.push(`max-age=${fallbackTtl}`);
|
||||
} else {
|
||||
directives.push(`max-age=${ttl}`);
|
||||
} else {
|
||||
directives.push(`max-age=${fallbackTtl}`);
|
||||
}
|
||||
|
||||
if (revalidate) {
|
||||
@ -42,5 +42,5 @@ module.exports = function setCacheControlHeader ({
|
||||
};
|
||||
|
||||
function everyAffectedTablesCanBeInvalidated (affectedTables) {
|
||||
return affectedTables && affectedTables.getTables().some(table => !table.updated_at);
|
||||
return affectedTables && affectedTables.getTables().every(table => !!table.updated_at);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user