check if fetch request returned a cached response?

In a worker if I have a fetch request:
const response = await fetch('...', {
// ...
cf: {
cacheTtl: 1 * 60 * 15, // 15m
cacheEverything: true
}
})
const response = await fetch('...', {
// ...
cf: {
cacheTtl: 1 * 60 * 15, // 15m
cacheEverything: true
}
})
is it possible to determine if it's a cache hit?
1 Reply
st
st5mo ago
console.log( Cache Status ${response.headers.get("CF-Cache-Status")} );
Want results from more Discord servers?
Add your server