@@ -3054,7 +3054,11 @@ export default abstract class Server<
3054
3054
}
3055
3055
)
3056
3056
3057
- if ( isPrefetchRSCRequest && typeof segmentPrefetchHeader === 'string' ) {
3057
+ if (
3058
+ isRoutePPREnabled &&
3059
+ isPrefetchRSCRequest &&
3060
+ typeof segmentPrefetchHeader === 'string'
3061
+ ) {
3058
3062
// This is a prefetch request issued by the client Segment Cache. These
3059
3063
// should never reach the application layer (lambda). We should either
3060
3064
// respond from the cache (HIT) or respond with 204 No Content (MISS).
@@ -3090,15 +3094,14 @@ export default abstract class Server<
3090
3094
// segment), we should *always* respond with a tree, even if PPR
3091
3095
// is disabled.
3092
3096
res . statusCode = 204
3093
- if ( isRoutePPREnabled ) {
3094
- // Set a header to indicate that PPR is enabled for this route. This
3095
- // lets the client distinguish between a regular cache miss and a cache
3096
- // miss due to PPR being disabled.
3097
- // NOTE: Theoretically, when PPR is enabled, there should *never* be
3098
- // a cache miss because we should generate a fallback route. So this
3099
- // is mostly defensive.
3100
- res . setHeader ( NEXT_DID_POSTPONE_HEADER , '1' )
3101
- }
3097
+
3098
+ // Set a header to indicate that PPR is enabled for this route. This
3099
+ // lets the client distinguish between a regular cache miss and a cache
3100
+ // miss due to PPR being disabled.
3101
+ // NOTE: Theoretically, when PPR is enabled, there should *never* be
3102
+ // a cache miss because we should generate a fallback route. So this
3103
+ // is mostly defensive.
3104
+ res . setHeader ( NEXT_DID_POSTPONE_HEADER , '1' )
3102
3105
return {
3103
3106
type : 'rsc' ,
3104
3107
body : RenderResult . fromStatic ( '' ) ,
0 commit comments