Created attachment 35453 [details] A sample servlet code to reproduce the issue The issue happens only on Oracle JDK 8 update 151/152, not before. Calling flush() on servlet response print writer while compression is enabled produces corrupted response. See attached servlet.
As a side note, without looking at the merits of the BZ, I'd like to point out that the very common habit of doing flush and/or close at the end of a servlet is a bad idea, it may impair better error processing and will always degrade performance.
This is a know issue with the JRE and will fixed in the next JRE release. https://bugs.openjdk.java.net/browse/JDK-8189788
*** Bug 61866 has been marked as a duplicate of this bug. ***