@@ -55,10 +55,10 @@ export default class ResponseCache {
55
55
// cache so just return the result of the response generator.
56
56
if ( ! key ) return responseGenerator ( false , null )
57
57
58
- const { incrementalCache } = context
58
+ const { incrementalCache, isOnDemandRevalidate = false } = context
59
59
60
60
return this . batcher . batch (
61
- { key, isOnDemandRevalidate : false } ,
61
+ { key, isOnDemandRevalidate } ,
62
62
async ( cacheKey , resolve ) => {
63
63
// We keep the previous cache entry around to leverage when the
64
64
// incremental cache is disabled in minimal mode.
@@ -77,7 +77,7 @@ export default class ResponseCache {
77
77
? await incrementalCache . get ( key )
78
78
: null
79
79
80
- if ( cachedResponse && ! context . isOnDemandRevalidate ) {
80
+ if ( cachedResponse && ! isOnDemandRevalidate ) {
81
81
if ( cachedResponse . value ?. kind === 'FETCH' ) {
82
82
throw new Error (
83
83
`invariant: unexpected cachedResponse of kind fetch in response cache`
@@ -118,7 +118,7 @@ export default class ResponseCache {
118
118
119
119
// For on-demand revalidate wait to resolve until cache is set.
120
120
// Otherwise resolve now.
121
- if ( ! context . isOnDemandRevalidate && ! resolved ) {
121
+ if ( ! isOnDemandRevalidate && ! resolved ) {
122
122
resolve ( resolveValue )
123
123
resolved = true
124
124
}
0 commit comments