You are currently browsing the Chetan Shah’s Blog weblog archives for the day 21 Jun 2008.
- AML (14)
- Foundation (4)
- Personal Finance (21)
- Technology (22)
- 7 Dec 2009: Move securities to Roth Account
- 28 Nov 2009: Leverage Checksum to determine identical files
- 4 Oct 2009: CAMS Certification Preparation
- 30 Aug 2009: Section 311 etc. (ACAMS Notes)
- 24 Aug 2009: FATF Membership Points (ACAMS Notes)
- 22 Aug 2009: Internet Casinos and Prepaid Cards/E-Cash (ACAMS Notes)
- 5 Aug 2009: Spousal IRA
- 15 May 2009: Buying Call Options.
- 7 Jan 2009: Watchlist filtering white paper
- 31 Oct 2008: Autonumber in Microsof Excel (works after inserting rows)
Archive for 21 Jun 2008
Improve HTML page loading time
21 Jun 2008 by Chetan Shah.
I cannot stress enough the importance of compression while loading html pages. One of the web applications (struts, weblogic implementation) I worked on was experiencing slowness while loading a search results page. The page used to take about 4 seconds to display (assume pure static content for the sake of this discussion) The page size was 638K! and there was no way I could reduce the amount of “visible” information.
Couple of things I observed and implemented which really helped cut 2 seconds of the page loading time. I am sure a lot is infrastructure dependent i.e : how stressed the network is etc. but there are things which are under developer’s control which we can leverage to improve page loading time.
Observation #1 :
The jsp had a for loop, which contained td style=”font-family: “Trebuchet MS”;font-size: 12px;color: #797b7a;font-weight: normal;” …. /td
I. e. : if the loop iterates for 500 times, that is the number of times “font-family: “Trebuchet MS”;font-size: 12px;color: #797b7a;font-weight: normal;” gets repeated.
Simple Solution : Point to note is : less number of characters used in the html (especially in a for loop) the better it is. Observation #2 : Simple Solution : The effort to compress at the server level and decompress at the browser level takes much less time as compared to transmit 350K over the wire. Many thanks to Jason Falkner for his excellent article on this. Completely agree with him to make the compression as part of a must-do for any web application
Posted in Technology | No Comments »
Put this in css, refer that css in your jsp and change the td to
. Huge reduction in generated html size. Instantly!
The page after it was built was not compressed. Even after the above change, the page was about 350K.
All browsers now support gzip compression. Add a filter at web.xml level and compress your html content before it hits the wire. A *huge* size savings here. The page size was reduced to 17K! while over the wire.
