Reusing empty HttpResponses

11 views
Skip to first unread message

lange....@gmail.com

unread,
Sep 20, 2016, 5:12:27 PM9/20/16
to Netty discussions
Hi,
I am wondering if reusing DefaultFullHttpResponses is supported.
Like 

  private static final DefaultFullHttpResponse NOCONTENT = new DefaultFullHttpResponse(HTTP_1_1, NO_CONTENT, false);


The underlying ByteBuf will be Unpooled.buffer(0), so I assume there is no problem with automatic reference counting, but I want to make sure I am not missing anything.

The use case is to reduce gc pressure when returning frequent no content and static answers like no_content or not_found or internal_server_error


Fabian

Reply all
Reply to author
Forward
0 new messages