What is the difference between using a cache-control
header and the cache
readonly property of the Request
interface?
From what I can tell, using the readonly cache
property is something like a shorthand for the more granular cache-control
header.
fetch('/foo', {
headers: {
'cache-control': 'no-store'
}
})
.then(res => res.json())
.then(data => console.log(data))
fetch('/foo', {
cache: 'no-store'
})
.then(res => res.json())
.then(data => console.log(data))