https://bz.apache.org/bugzilla/show_bug.cgi?id=67670
Bug ID: 67670
Summary: 20 seconds to download some JS files with 9.0.81
Product: Tomcat 9
Version: 9.0.81
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Connectors
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
After upgrading to Tomcat 9.0.81 from 9.0.80, I'm seeing some static JavaScript
assets take 20 seconds to return. The page rendering freezes while this is
happening.
I bisected the code between 9.0.80 and 9.0.81 and the following commit appears
to be responsible.
commit eca8f44c766c380c0d117dc7eca9d933aea71c38 (HEAD)
Author: shin-mallang <[email protected]>
Date: Sat Sep 9 22:09:03 2023 +0900
Relocate the useCompression check and apply parts back to back.
diff --git a/java/org/apache/coyote/http11/Http11Processor.java
b/java/org/apache/coyote/http11/Http11Processor.java
index aab2290407..ac531ad105 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -914,12 +914,6 @@ public class Http11Processor extends AbstractProcessor {
prepareSendfile(outputFilters);
}
- // Check for compression
- boolean useCompression = false;
- if (entityBody && sendfileData == null) {
- useCompression = protocol.useCompression(request, response);
- }
-
MimeHeaders headers = response.getMimeHeaders();
// A SC_NO_CONTENT response may include entity headers
if (entityBody || statusCode == HttpServletResponse.SC_NO_CONTENT) {
@@ -956,8 +950,11 @@ public class Http11Processor extends AbstractProcessor {
}
}
- if (useCompression) {
-
outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
+ // Check for compression
+ if (entityBody && sendfileData == null) {
+ if (protocol.useCompression(request, response)) {
+
outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
+ }
}
// Add date header unless application has already set one (e.g. in a
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]