[
https://issues.apache.org/jira/browse/WICKET-7046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17714028#comment-17714028
]
ASF GitHub Bot commented on WICKET-7046:
----------------------------------------
theigl merged PR #578:
URL: https://github.com/apache/wicket/pull/578
> Avoid allocating StringResponse when no response filters are active
> -------------------------------------------------------------------
>
> Key: WICKET-7046
> URL: https://issues.apache.org/jira/browse/WICKET-7046
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 9.12.0
> Reporter: Thomas Heigl
> Assignee: Thomas Heigl
> Priority: Major
>
> AjaxRequestHandler#respond currently always allocates a new StringResponse:
> {code:java}
> final StringResponse bodyResponse = new StringResponse();
> update.writeTo(bodyResponse, encoding);
> CharSequence filteredResponse = invokeResponseFilters(bodyResponse);
> response.write(filteredResponse);
> {code}
> Wrapping the response in a StringResponse is necessary for applying
> ResponseFilters that potentially modify the response.
> The thing is this: By default, a Wicket application running in deployment
> mode, does *not* have any response filters active. So in that case, we can
> avoid all of this expensive buffering.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)