You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@hlmksw.com> on 2007/01/18 18:45:56 UTC
Re: OFBiz UI work, Plus New Revelations
After spending some time examining the unintentional formatting changes in my
patch files, I discovered that my editor automatically strips off unnecessary
white space at the end of every line. I can't find a way to shut it off, so I'll
have to switch to another IDE.
At first I was upset that my editor would do such a thing without my permission.
Then I got to thinking that it makes a lot of sense. Less unnecessary white
space equals less fluff the compiler has to trudge through and less fluff in
HTML code.
Hey! Wait a second... many of those files that were unintentionally formatted
were FTL files. Does that mean that OFBiz servers are spewing out unnecessary
fluff? I viewed the page source on a typical OFBiz web page and sure enough -
OFBiz's markup has unnecessary white space at the end of the lines.
Going through all of the FTL files and cleaning them up would be easy to do with
a script or something, but the reduction in HTML output would be small. Where
I see a huge amount of unnecessary markup is with indentation. Our four
character indentation rule results in things like a simple </div> tag being
preceded by twelve to sixteen space characters. Our servers are working very
hard to output nicely indented markup.
Re: OFBiz UI work, Plus New Revelations
Posted by Adrian Crum <ad...@hlmksw.com>.
Jonathon -- Improov wrote:
> Adrian,
>
> I don't understand what you mean by "OFBiz servers are spewing out
> unnecessary stuff". Those FTLs with unnecessary whitespaces are probably
> coded that way (by mistake or otherwise), not generated and spewed by
> some servers.
The point I was making is that any unnecessary white space in FTL files
translates into unnecessary white space being served to web clients.
I was merely sharing an observation. I'm not suggesting that we change the best
practices.
Re: OFBiz UI work, Plus New Revelations
Posted by Jonathon -- Improov <jo...@improov.com>.
Adrian,
I don't understand what you mean by "OFBiz servers are spewing out unnecessary stuff". Those FTLs
with unnecessary whitespaces are probably coded that way (by mistake or otherwise), not generated
and spewed by some servers.
As for indentation, I recall the "best practices" page for contributors stating that all tabs
should be converted to spaces. That's quite the norm in many, if not all, projects. You mean you
found tabs in FTL sources?
In any case, all these don't affect me. Use Emacs! I don't remove or change any whitespaces, not
even change tabs to spaces.
Far as I'm concerned, I will continue to submit patches that have "intended changes only". I'm
kinda obsessive compulsively clean and organized. I'd rather have say the original authors clean
up the extra whitespaces, and check in with log saying "cleaned up whitespaces". My check in log
will only be "fixed this bug", not "fixed this bug, plus cleaned up whitespaces".
But yeah, your editor isn't wrong to clean up those whitespaces. No wait. It's wrong. Or at least
it's wrong not to allow you to configure that behavior.
Jonathon
Adrian Crum wrote:
> After spending some time examining the unintentional formatting changes
> in my patch files, I discovered that my editor automatically strips off
> unnecessary white space at the end of every line. I can't find a way to
> shut it off, so I'll have to switch to another IDE.
>
> At first I was upset that my editor would do such a thing without my
> permission. Then I got to thinking that it makes a lot of sense. Less
> unnecessary white space equals less fluff the compiler has to trudge
> through and less fluff in HTML code.
>
> Hey! Wait a second... many of those files that were unintentionally
> formatted were FTL files. Does that mean that OFBiz servers are spewing
> out unnecessary fluff? I viewed the page source on a typical OFBiz web
> page and sure enough - OFBiz's markup has unnecessary white space at the
> end of the lines.
>
> Going through all of the FTL files and cleaning them up would be easy to
> do with a script or something, but the reduction in HTML output would
> be small. Where I see a huge amount of unnecessary markup is with
> indentation. Our four character indentation rule results in things like
> a simple </div> tag being preceded by twelve to sixteen space
> characters. Our servers are working very hard to output nicely indented
> markup.
>
>
Re: OFBiz UI work, Plus New Revelations
Posted by Adrian Crum <ad...@hlmksw.com>.
Thanks Joe!
Joe Eckard wrote:
>
> On Jan 19, 2007, at 4:43 PM, Adrian Crum wrote:
>
>> I found on the Tomcat website a configuration setting for compressing
>> outgoing html/xml (http://tomcat.apache.org/tomcat-5.5-
>> doc/config/http.html) but I don't where to configure it in the
>> embedded version that OFBiz uses.
>
>
>
> It's under http-connector (already set in the default config):
>
> <property name="compressableMimeType" value="text/html,text/xml,text/
> plain"/>
> <property name="compression" value="on"/>
>
> -Joe
Re: OFBiz UI work, Plus New Revelations
Posted by Joe Eckard <jo...@redrocketcorp.com>.
On Jan 19, 2007, at 4:43 PM, Adrian Crum wrote:
> I found on the Tomcat website a configuration setting for
> compressing outgoing html/xml (http://tomcat.apache.org/tomcat-5.5-
> doc/config/http.html) but I don't where to configure it in the
> embedded version that OFBiz uses.
It's under http-connector (already set in the default config):
<property name="compressableMimeType" value="text/html,text/xml,text/
plain"/>
<property name="compression" value="on"/>
-Joe
Re: OFBiz UI work, Plus New Revelations
Posted by Adrian Crum <ad...@hlmksw.com>.
I found on the Tomcat website a configuration setting for compressing outgoing
html/xml (http://tomcat.apache.org/tomcat-5.5-doc/config/http.html) but I don't
where to configure it in the embedded version that OFBiz uses.
David E. Jones wrote:
>
> The best way I've seen to handle this sort of thing is to take
> advantage of the fact that pretty much all browsers support zipped
> pages. I haven't set this sort of thing up in a LONG time, but there
> are probably ways to do it with Tomcat, and definitely ways to do it
> with the Apache web server (httpd).
>
> -David
>
>
> On Jan 18, 2007, at 1:40 PM, Adrian Crum wrote:
>
>> Just for grins, I inserted <#compress> </#compress> FTL directives in
>> the Party Manager FTL files to see how much smaller the markup would
>> be. Results:
>>
>> Before compress - 45k
>> After compress - 35k
>> 33% less markup.
>>
>> The drawback is, some of the layout seems to depend on some of the
>> FTL whitespace, so the page's appearance changed a little.
>>
>>
>> Adrian Crum wrote:
>>
>>> After spending some time examining the unintentional formatting
>>> changes in my patch files, I discovered that my editor automatically
>>> strips off unnecessary white space at the end of every line. I can't
>>> find a way to shut it off, so I'll have to switch to another IDE.
>>> At first I was upset that my editor would do such a thing without my
>>> permission. Then I got to thinking that it makes a lot of sense.
>>> Less unnecessary white space equals less fluff the compiler has to
>>> trudge through and less fluff in HTML code.
>>> Hey! Wait a second... many of those files that were unintentionally
>>> formatted were FTL files. Does that mean that OFBiz servers are
>>> spewing out unnecessary fluff? I viewed the page source on a typical
>>> OFBiz web page and sure enough - OFBiz's markup has unnecessary
>>> white space at the end of the lines.
>>> Going through all of the FTL files and cleaning them up would be
>>> easy to do with a script or something, but the reduction in HTML
>>> output would be small. Where I see a huge amount of unnecessary
>>> markup is with indentation. Our four character indentation rule
>>> results in things like a simple </div> tag being preceded by twelve
>>> to sixteen space characters. Our servers are working very hard to
>>> output nicely indented markup.
>
>
Re: OFBiz UI work, Plus New Revelations
Posted by Adrian Crum <ad...@hlmksw.com>.
Oh wait. I misread what you said. You're suggesting zipped pages sent out from
the server that the browser can unzip. Gotcha. Great idea. Thanks.
Adrian Crum wrote:
> As I mentioned in another email, I was just making an observation. It's
> food for thought.
>
> The zipped pages browser setting doesn't address the fundamental issue I
> presented: OFBiz servers are pushing out a lot of unnecessary markup.
>
> It would be interesting to try out an OFBiz installation where
> Freemarker/Tomcat/whatever is set up to compress ALL markup, then see
> how much more responsive the web site is.
>
>
> David E. Jones wrote:
>
>>
>> The best way I've seen to handle this sort of thing is to take
>> advantage of the fact that pretty much all browsers support zipped
>> pages. I haven't set this sort of thing up in a LONG time, but there
>> are probably ways to do it with Tomcat, and definitely ways to do it
>> with the Apache web server (httpd).
>>
>> -David
>>
>>
>> On Jan 18, 2007, at 1:40 PM, Adrian Crum wrote:
>>
>>> Just for grins, I inserted <#compress> </#compress> FTL directives
>>> in the Party Manager FTL files to see how much smaller the markup
>>> would be. Results:
>>>
>>> Before compress - 45k
>>> After compress - 35k
>>> 33% less markup.
>>>
>>> The drawback is, some of the layout seems to depend on some of the
>>> FTL whitespace, so the page's appearance changed a little.
>>>
>>>
>>> Adrian Crum wrote:
>>>
>>>> After spending some time examining the unintentional formatting
>>>> changes in my patch files, I discovered that my editor
>>>> automatically strips off unnecessary white space at the end of
>>>> every line. I can't find a way to shut it off, so I'll have to
>>>> switch to another IDE.
>>>> At first I was upset that my editor would do such a thing without
>>>> my permission. Then I got to thinking that it makes a lot of sense.
>>>> Less unnecessary white space equals less fluff the compiler has to
>>>> trudge through and less fluff in HTML code.
>>>> Hey! Wait a second... many of those files that were unintentionally
>>>> formatted were FTL files. Does that mean that OFBiz servers are
>>>> spewing out unnecessary fluff? I viewed the page source on a
>>>> typical OFBiz web page and sure enough - OFBiz's markup has
>>>> unnecessary white space at the end of the lines.
>>>> Going through all of the FTL files and cleaning them up would be
>>>> easy to do with a script or something, but the reduction in HTML
>>>> output would be small. Where I see a huge amount of unnecessary
>>>> markup is with indentation. Our four character indentation rule
>>>> results in things like a simple </div> tag being preceded by twelve
>>>> to sixteen space characters. Our servers are working very hard to
>>>> output nicely indented markup.
>>
>>
>>
>
Re: OFBiz UI work, Plus New Revelations
Posted by Jonathon -- Improov <jo...@improov.com>.
Adrian,
> The zipped pages browser setting doesn't address the fundamental issue I
> presented: OFBiz servers are pushing out a lot of unnecessary markup.
I'd guess there won't be too much unnecessary "whitespaces" (is this what you mean by unnecessary
markup?). But I don't know. Someone could be crazy and code tons of unnecessary whitespaces into
an FTL.
> It would be interesting to try out an OFBiz installation where
> Freemarker/Tomcat/whatever is set up to compress ALL markup, then see
> how much more responsive the web site is.
Not by much if server-side processing is hefty. Savings from reduced time of transfer (of web
content) is amortized in that case.
But in general, if you can, use compression. Or actually, for maximum compatibility with all
browsers, maybe we shouldn't (we never know).
Jonathon
Adrian Crum wrote:
> As I mentioned in another email, I was just making an observation. It's
> food for thought.
>
> The zipped pages browser setting doesn't address the fundamental issue I
> presented: OFBiz servers are pushing out a lot of unnecessary markup.
>
> It would be interesting to try out an OFBiz installation where
> Freemarker/Tomcat/whatever is set up to compress ALL markup, then see
> how much more responsive the web site is.
>
>
> David E. Jones wrote:
>>
>> The best way I've seen to handle this sort of thing is to take
>> advantage of the fact that pretty much all browsers support zipped
>> pages. I haven't set this sort of thing up in a LONG time, but there
>> are probably ways to do it with Tomcat, and definitely ways to do it
>> with the Apache web server (httpd).
>>
>> -David
>>
>>
>> On Jan 18, 2007, at 1:40 PM, Adrian Crum wrote:
>>
>>> Just for grins, I inserted <#compress> </#compress> FTL directives
>>> in the Party Manager FTL files to see how much smaller the markup
>>> would be. Results:
>>>
>>> Before compress - 45k
>>> After compress - 35k
>>> 33% less markup.
>>>
>>> The drawback is, some of the layout seems to depend on some of the
>>> FTL whitespace, so the page's appearance changed a little.
>>>
>>>
>>> Adrian Crum wrote:
>>>
>>>> After spending some time examining the unintentional formatting
>>>> changes in my patch files, I discovered that my editor
>>>> automatically strips off unnecessary white space at the end of
>>>> every line. I can't find a way to shut it off, so I'll have to
>>>> switch to another IDE.
>>>> At first I was upset that my editor would do such a thing without
>>>> my permission. Then I got to thinking that it makes a lot of sense.
>>>> Less unnecessary white space equals less fluff the compiler has to
>>>> trudge through and less fluff in HTML code.
>>>> Hey! Wait a second... many of those files that were unintentionally
>>>> formatted were FTL files. Does that mean that OFBiz servers are
>>>> spewing out unnecessary fluff? I viewed the page source on a
>>>> typical OFBiz web page and sure enough - OFBiz's markup has
>>>> unnecessary white space at the end of the lines.
>>>> Going through all of the FTL files and cleaning them up would be
>>>> easy to do with a script or something, but the reduction in HTML
>>>> output would be small. Where I see a huge amount of unnecessary
>>>> markup is with indentation. Our four character indentation rule
>>>> results in things like a simple </div> tag being preceded by twelve
>>>> to sixteen space characters. Our servers are working very hard to
>>>> output nicely indented markup.
>>
>>
>
>
Re: OFBiz UI work, Plus New Revelations
Posted by Adrian Crum <ad...@hlmksw.com>.
As I mentioned in another email, I was just making an observation. It's food for
thought.
The zipped pages browser setting doesn't address the fundamental issue I
presented: OFBiz servers are pushing out a lot of unnecessary markup.
It would be interesting to try out an OFBiz installation where
Freemarker/Tomcat/whatever is set up to compress ALL markup, then see how much
more responsive the web site is.
David E. Jones wrote:
>
> The best way I've seen to handle this sort of thing is to take
> advantage of the fact that pretty much all browsers support zipped
> pages. I haven't set this sort of thing up in a LONG time, but there
> are probably ways to do it with Tomcat, and definitely ways to do it
> with the Apache web server (httpd).
>
> -David
>
>
> On Jan 18, 2007, at 1:40 PM, Adrian Crum wrote:
>
>> Just for grins, I inserted <#compress> </#compress> FTL directives in
>> the Party Manager FTL files to see how much smaller the markup would
>> be. Results:
>>
>> Before compress - 45k
>> After compress - 35k
>> 33% less markup.
>>
>> The drawback is, some of the layout seems to depend on some of the
>> FTL whitespace, so the page's appearance changed a little.
>>
>>
>> Adrian Crum wrote:
>>
>>> After spending some time examining the unintentional formatting
>>> changes in my patch files, I discovered that my editor automatically
>>> strips off unnecessary white space at the end of every line. I can't
>>> find a way to shut it off, so I'll have to switch to another IDE.
>>> At first I was upset that my editor would do such a thing without my
>>> permission. Then I got to thinking that it makes a lot of sense.
>>> Less unnecessary white space equals less fluff the compiler has to
>>> trudge through and less fluff in HTML code.
>>> Hey! Wait a second... many of those files that were unintentionally
>>> formatted were FTL files. Does that mean that OFBiz servers are
>>> spewing out unnecessary fluff? I viewed the page source on a typical
>>> OFBiz web page and sure enough - OFBiz's markup has unnecessary
>>> white space at the end of the lines.
>>> Going through all of the FTL files and cleaning them up would be
>>> easy to do with a script or something, but the reduction in HTML
>>> output would be small. Where I see a huge amount of unnecessary
>>> markup is with indentation. Our four character indentation rule
>>> results in things like a simple </div> tag being preceded by twelve
>>> to sixteen space characters. Our servers are working very hard to
>>> output nicely indented markup.
>
>
Re: OFBiz UI work, Plus New Revelations
Posted by "David E. Jones" <jo...@hotwaxmedia.com>.
The best way I've seen to handle this sort of thing is to take
advantage of the fact that pretty much all browsers support zipped
pages. I haven't set this sort of thing up in a LONG time, but there
are probably ways to do it with Tomcat, and definitely ways to do it
with the Apache web server (httpd).
-David
On Jan 18, 2007, at 1:40 PM, Adrian Crum wrote:
> Just for grins, I inserted <#compress> </#compress> FTL directives
> in the Party Manager FTL files to see how much smaller the markup
> would be. Results:
>
> Before compress - 45k
> After compress - 35k
> 33% less markup.
>
> The drawback is, some of the layout seems to depend on some of the
> FTL whitespace, so the page's appearance changed a little.
>
>
> Adrian Crum wrote:
>
>> After spending some time examining the unintentional formatting
>> changes in my patch files, I discovered that my editor
>> automatically strips off unnecessary white space at the end of
>> every line. I can't find a way to shut it off, so I'll have to
>> switch to another IDE.
>> At first I was upset that my editor would do such a thing without
>> my permission. Then I got to thinking that it makes a lot of
>> sense. Less unnecessary white space equals less fluff the compiler
>> has to trudge through and less fluff in HTML code.
>> Hey! Wait a second... many of those files that were
>> unintentionally formatted were FTL files. Does that mean that
>> OFBiz servers are spewing out unnecessary fluff? I viewed the page
>> source on a typical OFBiz web page and sure enough - OFBiz's
>> markup has unnecessary white space at the end of the lines.
>> Going through all of the FTL files and cleaning them up would be
>> easy to do with a script or something, but the reduction in HTML
>> output would be small. Where I see a huge amount of unnecessary
>> markup is with indentation. Our four character indentation rule
>> results in things like a simple </div> tag being preceded by
>> twelve to sixteen space characters. Our servers are working very
>> hard to output nicely indented markup.
Re: OFBiz UI work, Plus New Revelations
Posted by Adrian Crum <ad...@hlmksw.com>.
Just for grins, I inserted <#compress> </#compress> FTL directives in the Party
Manager FTL files to see how much smaller the markup would be. Results:
Before compress - 45k
After compress - 35k
33% less markup.
The drawback is, some of the layout seems to depend on some of the FTL
whitespace, so the page's appearance changed a little.
Adrian Crum wrote:
> After spending some time examining the unintentional formatting changes
> in my patch files, I discovered that my editor automatically strips off
> unnecessary white space at the end of every line. I can't find a way to
> shut it off, so I'll have to switch to another IDE.
>
> At first I was upset that my editor would do such a thing without my
> permission. Then I got to thinking that it makes a lot of sense. Less
> unnecessary white space equals less fluff the compiler has to trudge
> through and less fluff in HTML code.
>
> Hey! Wait a second... many of those files that were unintentionally
> formatted were FTL files. Does that mean that OFBiz servers are spewing
> out unnecessary fluff? I viewed the page source on a typical OFBiz web
> page and sure enough - OFBiz's markup has unnecessary white space at the
> end of the lines.
>
> Going through all of the FTL files and cleaning them up would be easy to
> do with a script or something, but the reduction in HTML output would
> be small. Where I see a huge amount of unnecessary markup is with
> indentation. Our four character indentation rule results in things like
> a simple </div> tag being preceded by twelve to sixteen space
> characters. Our servers are working very hard to output nicely indented
> markup.
>
>