Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce committed Oct 13, 2017
1 parent 488ffdd commit dae25d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lighthouse-core/audits/byte-efficiency/cache-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class CacheHeaders extends ByteEfficiencyAudit {

if (headers.has('expires')) {
const expires = new Date(headers.get('expires')).getTime();
// Invalid expires values MUST be treated as already expired
if (!expires) return 0;
return Math.max(0, (Date.now() - expires) / 1000);
}
Expand Down

0 comments on commit dae25d2

Please sign in to comment.