ChristopherSchultz edited a comment 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) {
<a href="">whatever</a>
} else {
<a href="">something else</a>
}
}
}
```
What you'd love to have in the output is a series of these:
<a href="">whatever</a>
<a href="">something else</a>
<a href="">whatever</a>
<a href="">something else</a>
<a href="">something else</a>
<a href="">whatever</a>
<a href="">something else</a>
<a href="">something else</a>
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]