Hello all,
Recently, we found a KFS page can be large up to 60MB in size. In the page, there are a lot of blank lines. A tool, HTML Tidy, can clear up the HTML, and reduce its size to 2MB. That means there are a large amount of useless blanks to be transferred to users and increase the page loading time.
This issue may be caused by JSP 2.0 and below, which leaves a lot of blank paragraphs in the generated HTML page. As I know, JSP 2.1 provides a page directive to trim the spaces (TrimWhiteSpace).
I just wonder whether anyone else in the community is using HTML Tidy, JSP 2.1 TrimWhiteSpace or similar technology in KFS implementation. If so, could you share your experience/observation with us?
Thanks,
Bin
Hi Bin,
We are using Tidy for KRAD (actually jTidy). There is a filter that can be used in the application to tidy up the pages (including removing the blank lines). As you point out this significantly reduces the size of the response and makes the HTML much more readable. This will be in place for Rice 2.0, for pages that use KRAD (Inquiry, Lookup, and Maintenance initially). Here is a link to the project page:
http://jtidy.sourceforge.net/multiproject/jtidyservlet/filter.html
Jerry
Thanks, Jerry.
I tried the filter a little bit. It worked great for lookup/maintenance/inquiry, but the financial document and KFS logo cannot be displayed correctly since JTidy changed/removed some HTML code. Can we use any configuration to instruct JTidy to remove the blank lines only?
Thanks,
Bin
Actually one more follow up on this, there is no reason why we could not apply to filter to pages still coming from Struts as well. If that is
something the community is interested in I will talk to the Rice team.
Jerry
From: Jerry Neal [mailto:jkn...@indiana.edu]
Sent: Wednesday, March 16, 2011 10:36 AM
To: 'Gao, Bin'; kfs.techni...@kuali.org; rice....@kuali.org
Oh, I didn’t have that problem. Yes it has lots of configuration. Here is our current config:
<filter>
<filter-name>JTidyFilter</filter-name>
<filter-class>org.w3c.tidy.servlet.filter.JTidyFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>wrap: 220;tidyMark: FALSE;smartIndent: TRUE;</param-value>
</init-param>
</filter>
There are several more options as well (not documented but if you poke around in the source there is a class that defines them all, can’t remember
the name of hand).
It would be great to put such a topic, broadly a part of web optimization, in our plate.
I believe MSU would appreciate any solution/recommendation to this from the Foundation.
Thanks,
Bin
Thanks, Leo.
This is one of solutions. Do you have any idea whether all web/application servers have such feature?
Bin