Skip to content

Commit 407b994

Browse files
authored
Refine cached response with writing and flushing (#13)
```release-note 优化缓存内容响应 ```
1 parent 4585e51 commit 407b994

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/main/java/run/halo/cache/page/PageCacheWebFilter.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private Mono<Void> writeCachedResponse(ServerHttpResponse response,
124124
response.getHeaders().setInstant("X-Halo-Cache-At", cachedResponse.getTimestamp());
125125
var body = Flux.fromIterable(cachedResponse.getBody())
126126
.map(byteBuffer -> response.bufferFactory().wrap(byteBuffer));
127-
return response.writeWith(body);
127+
return response.writeAndFlushWith(Flux.from(body).window(1));
128128
}
129129

130130
class CacheResponseDecorator extends ServerHttpResponseDecorator {

0 commit comments

Comments
 (0)