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

Delegating ServletOutputStream implementations should delegate calls for writing chunks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.1
    • Component/s: None
    • Labels:
      None
    • Magnolia Release:
      5.2.1

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: