Open davalapar opened 4 years ago
config.userAgent
Stringconfig.query
Objectconfig.text
Booleanconfig.json
Booleanconfig.body
Objectconfig.form
Arrayconfig.compression
Booleanconfig.destination
Booleanconfig.timeout
Numberconfig.maxSize
Numbererror.data
content-length
header verificationcontent-type: application/json
Date.parse('Wed, 30 Oct 2019 15:50:06 GMT'); // ms string
new Date().toUTCString(); // utc date
We must cache if
Expires
header field existsmax-age
response directive existss-maxage
response directive exists, if the cache is sharedCache Control Extention
that allows it to be cached, aka the Cache-Control
header fieldWe must not cache if
no-store
cache directive existsprivate
response directive exists, if the cache is sharedAuthorization
header field exists, if the cache is shared{
authType: '',
authCredentials: '',
}
new Map()
and function () {}
analyze caching
onHeader: (headers) => {
// https://nodejs.org/api/http.html#http_response_getheaders
},
onProgress: (chunkSize, hContentLength) => {
}
onHeader
eventonProgress: (chunkSize, rContentLength, hContentLength) => {}
stream: true
, incompat dest, text, jsonmaxSize
compliance even without hContentLength
, using rContentLength
onProgress
compliance wven without hContentLength
response.on('close', () => {})
eventrequest.isStream(value)
convenience function using https://github.com/sindresorhus/is-stream