Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-7046

Avoid allocating StringResponse when no response filters are active

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 9.12.0
    • 10.0.0-M1, 9.14.0
    • wicket-core
    • None

    Description

      AjaxRequestHandler#respond currently always allocates a new StringResponse:

      final StringResponse bodyResponse = new StringResponse();
      update.writeTo(bodyResponse, encoding);
      CharSequence filteredResponse = invokeResponseFilters(bodyResponse);
      response.write(filteredResponse);
      

      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.

      Attachments

        Issue Links

          Activity

            People

              thomas.heigl Thomas Heigl
              thomas.heigl Thomas Heigl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: