@@ -5,7 +5,10 @@ const statusCodeCacheableByDefault = [200, 203, 204, 206, 300, 301, 404, 405, 41
55// This implementation does not understand partial responses (206)
66const understoodStatuses = [ 200 , 203 , 204 , 300 , 301 , 302 , 303 , 307 , 308 , 404 , 405 , 410 , 414 , 501 ] ;
77
8- const hopByHopHeaders = { 'connection' :true , 'keep-alive' :true , 'proxy-authenticate' :true , 'proxy-authorization' :true , 'te' :true , 'trailer' :true , 'transfer-encoding' :true , 'upgrade' :true } ;
8+ const hopByHopHeaders = {
9+ 'date' : true , // included, because we add Age update Date
10+ 'connection' :true , 'keep-alive' :true , 'proxy-authenticate' :true , 'proxy-authorization' :true , 'te' :true , 'trailer' :true , 'transfer-encoding' :true , 'upgrade' :true
11+ } ;
912const excludedFromRevalidationUpdate = {
1013 // Since the old body is reused, it doesn't make sense to change properties of the body
1114 'content-length' : true , 'content-encoding' : true , 'transfer-encoding' : true ,
@@ -229,6 +232,7 @@ module.exports = class CachePolicy {
229232 headers . warning = ( headers . warning ? `${ headers . warning } , ` : '' ) + '113 - "rfc7234 5.5.4"' ;
230233 }
231234 headers . age = `${ Math . round ( age ) } ` ;
235+ headers . date = new Date ( this . now ( ) ) . toUTCString ( ) ;
232236 return headers ;
233237 }
234238
0 commit comments