Skip to content

Commit

Permalink
Write and flush cached response
Browse files Browse the repository at this point in the history
Signed-off-by: JohnNiang <johnniang@foxmail.com>
  • Loading branch information
JohnNiang committed Oct 14, 2024
1 parent 4585e51 commit c1e32ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/run/halo/cache/page/PageCacheWebFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private Mono<Void> writeCachedResponse(ServerHttpResponse response,
response.getHeaders().setInstant("X-Halo-Cache-At", cachedResponse.getTimestamp());
var body = Flux.fromIterable(cachedResponse.getBody())
.map(byteBuffer -> response.bufferFactory().wrap(byteBuffer));
return response.writeWith(body);
return response.writeAndFlushWith(Flux.from(body).window(1));
}

class CacheResponseDecorator extends ServerHttpResponseDecorator {
Expand Down

0 comments on commit c1e32ad

Please sign in to comment.