Analyzing your web page performance with Page Speed

I notice that somehow my image gallery animation is very jaggy when I view it from google app engine.  The weird thing is when I open the HTML page in my local box,not through google app engine, the animation is very very smooth.

From what I understand is that a browser will cache/download an HTML page, its javascript, and any related style sheet to the user local box when they view a website. Based on this notion, there should not be any server side processing for my image gallery. All the processing should be done at the client side/ user browser locally in their box.

Some helpful people from stack over flow got me thinking about java script best practices and performance. I came across this very nifty firebug plugin for firefox 3.5 + in google code, called page speed. This tool is very handy to analyze ways to optimize your webpage. This is what the plugin say about my image gallery:

I decided to investigate how to resolve  some of the critical items on the list

1. Minify the javascript

After searching for possible solutions through Google, I decided to user YUI Compressor to ‘minify’ my javascript.

2. Enabling Compression

We can configure our web servers to send our web page in gZip. gzip is based on the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. DEFLATE was intended as a replacement for LZW and other patent-encumbered data compression algorithms which, at the time, limited the usability of compress and other popular archivers.Our browser need to send a HTTP request:  ‘Accept-Encoding: gzip, deflate' to let the server know that our browser can handle gZip files. The web server will then send back a response saying : 'Content-Encoding: gzip ' to tell our browser that it is sending back a gZip-ed file.

This is how we can enable gZip compression:

1. Apache

Add the following entry to the ‘.htAccess’ file

# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

# Or, compress certain file types by extension:
<files *.html="">
SetOutputFilter DEFLATE
</files>

2. Tomcat

Edit ‘/conf/server.xml’ and add to the HTTP Connector configuration something like this:

<connector port="8080" maxhttpheadersize="8192" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" redirectport="8443" acceptcount="100" connectiontimeout="20000" disableuploadtimeout="true" compression="on" compressionminsize="2048" nocompressionuseragents="gozilla, traviata" compressablemimetype="text/html,text/xml"></connector>

So far I can’t find any evidence that Google App Engine support compression. I need to do further research on Google App Engine.

Advertisements

About zainul franciscus

Hi, I am a software developer and tech blogger who is currently living in Wellington, New Zealand. I write stuff that I find interesting on
This entry was posted in nu-lightbox, programming, web development and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s