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 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 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.


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 Do I need to install any fix packs? Could you please help me?

Karan said...

Hi Apps,

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

I have WAS installed on my test environment.

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