Trimming white space and entra lines from the markup generated by WebSphere Application Serve

If you look at the HTML markup generated for IBM's default page you will notice that it has lot of white spaces and though they increase size of the response they are not required to display the page properly. If you set the com.ibm.wsspi.jsp.usecdatatrim custom property to true for your JSP engine, all of the white space and extra lines in the generated Java code are stripped out.

Take a look at the page which has two portlets and default IBM theme,



The page that gets generated is 64kb's in size and if you look at the view source you can see all the white spaces.

Now set com.ibm.wsspi.jsp.usecdatatrim equal to true as Web Container Custom property like this



Restart the server and try accessing the same page, you will notice that the size of the markup is reduced to 56.4 kb (Which is saving of close to 15 %) like this



The saving size could be much larger if your page is more complex.

4 comments:

Anonymous said...

This was a really a useful information. Thanks Sunil for sharing this.

Apps said...

Hi Sunil,
I tried this approach for removing the white spaces from the Portal response.
But I see not difference in the response even after making the changes. I restarted the Server twice, but no luck. My Portal is deployed on WAS 7.0.0.5. Do I need to install any fix packs? Could you please help me?

Karan Aggarwal said...

Hi Apps,


You need to have WAS 7.0.0.19.
I have WAS 7.0.0.19 installed on my test environment.

I have WAS 7.0.0.17 installed on my test environment.

I am not able to see white spaces in my Dev environment i.e 7.0.0.19

Abhi said...

Thanks for info
Web Design Company in Bangalore
Website development in Bangalore