Uploaded image for project: 'Cache Modules'
  1. Cache Modules
  2. MGNLCACHE-35

Delegating ServletOutputStream implementations should delegate calls for writing chunks

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 5.2.1
    • None
    • None
    • None

      Currently GZipCacheResponseWrapper.DeferredServletOutputStream and SimpleServletOutputStream only overrides write(byte) and therefore each byte is treated individually when written to the output stream.

      This happens when we're caching, for instance serving pages via RenderingEngine, images from the imaging module and the dam module.

      We also go through this code when the gzip filter wraps the response in order to compress it.

      By implementing write(byte[]) and write(byte[], int, int) we can reduce the amount of work needed both in these classes and the classes being delegated to. Specifically ThresholdingOutputStream can test if the threshold will be exceeded once instead of for every byte.

      The improvements in performance by this fix has been measured to be very limited.

        Acceptance criteria

              tmattsson Tobias Mattsson
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD