[GitHub] [tomcat] ChristopherSchultz commented on pull request #351: Remove White Spaces from the JSP files
ChristopherSchultz commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-697473351 @rotty3000 This is what I was thinking would be better than post-processing. The JSP->class translation should be a one-time hit rather than a filtering-step that requires CPU time and possibly more buffering for each response. @markt-asf Reducing useless whitespace and compression are both ways of reducing the overall bulk of a response. In one case (whitespace) you are removing literally useless data. In the other case, you are retaining *all* the useful data but reducing the size. The two together are better than either one alone IMO. But comparing the two directly is a false equivalence: it's not fair to say "you get a bigger benefit from using gzip vs. whitespace trimming" because they are different things. Not trying to cause a big fight; just mentioning that they are both pieces of a larger puzzle. Finally, a post-processing HTML-reducing filter would be useful for situations where JSP isn't being used _at all_ and might be a superior solution merely due to its flexibility. There are those performance considerations, though, of course. But we are talking about a trade-off between (essentially) CPU usage and network bulk, so there will always be a trade-off. 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
[GitHub] [tomcat] ChristopherSchultz commented on pull request #351: Remove White Spaces from the JSP files
ChristopherSchultz commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-697345837 I still think gzip is a red herring, here. If you remove whitespace prior to gzipping, you'll likely see that gzip gives you a lower compression ratio when comparing the stripped-text versus non-stripped-text against the final result. Comparing the original text to the stripped-text versus non-stripped text will be a better comparison. But the main point is that removing whitespace itself is an optimization itself whether gzip is at play or not. 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
[GitHub] [tomcat] ChristopherSchultz commented on pull request #351: Remove White Spaces from the JSP files
ChristopherSchultz commented on pull request #351: URL: https://github.com/apache/tomcat/pull/351#issuecomment-695046168 Playing the devil's advocate, here, for a moment: 1. `gzip` is not a solution, here, because it "hides" the problem instead of solving it. If the whitespace is unwanted, then remove the whitespace. You can then `gzip` and get even better compression! 2. This is an issue for any source code where source-indentation is valuable for the programmer/debugger, but useless in the output. I have the same problem with Velocity templates. Any structure which looks like this produces hude amounts of useless whitespace in the output: foreach(thing) { for(thing.otherThing) { if(foo) { whatever } else { something else } } } What you'd love to have in the output is a series of these: whatever something else whatever something else something else whatever something else something else But instead, you get all of the above _plus_ the indentation from each of those foreach/if/else/close-brace lines which are here to make sure the programmer doesn't go crazy. So there is something to be said for the removal of the whitespace. I'm not 100% convinced this is the right approach, but the problem definitely exists and it would be nice to have a solution. 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