kamnani commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-695044633
> Have you considered using gzip compression for such big responses? It'd help much better that the white space stripping. > […](#) > On Fri, Sep 18, 2020, 20:39 kamnani ***@***.***> wrote: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <c:if test="${isDebug || (feature.type != 'HIDDEN')}"> <c:set var="includeDebug" value="${isDebug && (not (feature.featureName eq 'debug'))}"/> <c:if test="${includeDebug}"> <div id="${feature.featureName}-debug" class="feature-debug"> <ul id="${feature.featureName}-tabs" class="debug-tabs"></ul> </c:if> <c:if test="${not empty feature.containerId || feature.type == 'CONTAINER'}"> <c:set var="isClientSideInstrumentationEnabled" value = "${clientSideInstrumentationTreatment eq 'T1'}"/> <c:choose> <c:when test="${isClientSideInstrumentationEnabled}"> <c:choose> <c:when test="${not empty feature.flavorId}"> <c:set var="***" value="*** flavor-${feature.***}" /> </c:when> <c:otherwise> <c:set var="***" value="***" /> </c:otherwise> </c:choose> <div id="${not empty feature.containerId ? feature.co ntainerId : feature.featureName }" class="${***}" data-feature-name="${feature.featureName}"> </c:when> <c:otherwise> <div id="${not empty feature.containerId ? feature.containerId : feature.featureName }" class="feature" data-feature-name="${feature.featureName}"> </c:otherwise> </c:choose> </c:if> <c:set var="timerMetric">${feature.featureName}:jsp-exec-time</c:set> <c:catch var="jspError"> <%-- PLEASE ENSURE ANY CHANGES MADE HERE ARE KEPT IN SYNC WITH /WEB-INF/views/jsp/ajax/****.jsp --%> <c:choose> <c:when test="${feature.type == 'DYNAMIC'}"> <c:if test="${not empty feature.template}"> <c:choose> <c:when test="${edpEnabled}"> <c:set var="edpFeature" value="${feature}" scope="request"/> <jsp:include page="/WEB-INF/views/jsp/features/edp/utils/include-edp-dynamic-feature.jsp"/> <c:remove var="edpFeature" scope="request"/> </c:when> <c:otherwise> <jsp:include page="${feature.template}"/> </c:otherwise> </c:choose> </c:if> </c:when> <c:when test="${feature.type == 'REMOTE'}"> <c:set var="module" value="${requestScope[feature.featureName]}"/> <c:choose> <c:when test="${not empty feature.template}"><jsp:include page="${feature.template}"/></c:when> <c:when test="${not empty module && not module.hasError && not empty module.content}">${module.content}</c:when> </c:choose> </c:when> <c:when test="${feature.type == '----'}"> <c:choose> <c:when test="${not empty feature.template}"> <jsp:include page="${feature.template}"> <jsp:param name="slotName" value="${feature.slotName}"/> </jsp:include> </c:when> </c:choose> </c:when> <c:when test="${feature.type == 'CONTAINER'}"> <c:if test="${not empty feature.template}"> <jsp:include page="${feature.template}" > <jsp:param name="configPath" value="${feature.configPath}"/> </jsp:include> </c:if> </c:when> <c:when test="${feature.type == 'STATIC'}"> <c:choose> <c:when test="${not empty feature.template}"> <jsp:include page="${feature.template}"/> </c:when> <c:otherwise> ${feature.content} </c:otherwise> </c:choose> </c:when> <c:when test="${feature.type == 'PLACEHOLDER'}">${feature.content}</c:when> </c:choose> <c:if test="${(fn:toLowerCase(feature.featureName) == '***') || (fn:toLowerCase(feature.featureName) == '***') || (fn:toLowerCase(feature.featureName) == '**') || (fn:toLowerCase(feature.featureName) == '***') || (fn:toLowerCase(feature.featureName) == '***') || (fn:toLowerCase(feature.featureName) == '***') || (fn:toLowerCase(feature.featureName) == '***') }"> </c:if> <%@ include file="criticalFeatureLogging.jsp" %> </c:catch> <c:if test="${not empty jspError}"> <jsp:include page="/WEB-INF/views/jsp/utils/errorHandler.jsp"> <jsp:param name="exception" value="${jspError}" /> <jsp:param name="featureName" value="${feature.featureName}" /> </jsp:include> </c:if> <c:if test="${includeDebug}"> <!-- Place data into a div to escape characters, div is later removed --> <c:if test="${not empty jspError}"> <div id="${feature.featureName}-jsp-error" style="display: none;">${jspError}</div> </c:if> <c:catch > <c:if test="${not empty module.moduleError}"> <div > id="${feature.featureName}-module-error" style="display: > none;">${module.moduleError}</div> </c:if> </c:catch> <div > id="${feature.featureName}-view-model" style="display: > none;">${requestScope[feature.featureName]}</div> </c:if> <c:if test="${not > empty feature.containerId || feature.type == 'CONTAINER'}"> </div> </c:if> > <c:if test="${includeDebug}"> </div> <%@ include > file="/WEB-INF/views/jsp/features/debug/includeIsDebugJs.jsp" %> </c:if> > </c:if> 1. This is from a real file in a critical application but we > stripped(or even marked ***) out certain proprietary lines. If there is an > error or such that's why. 2. The indented tags such as line 12 results in > white space on the html output. This white space is eliminated via this > change. 3. Our application is filled with neatly-formatted JSPs that output > waste such as that. One public-facing HTML page became 20% smaller after > implementing this. — You are receiving this because you wer e mentioned. Reply to this email directly, view it on GitHub <[#351 (comment)](https://github.com/apache/tomcat/pull/351#issuecomment-694997270)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABYUQSCFOPFIU2VDW3NTNDSGOLNRANCNFSM4QTRLR2Q> . GZIP compression is good for interleaved whitespace (90+%), however good is neither free nor complete (100%). ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org