I was procrastinating on an important feature in Chennai Bus Routes and Suburban Trains Information website, contemplating numerous options on how to implement it, since I feared it can make me go over the free quota in my Google App Engine deployment.
The feature was to enable users to identify hopping/switching points to travel between localities which are not directly connected by MTC buses / suburban trains. This planned feature was going to be a bit resource intensive – either with CPU, if done dynamically or with storage-and-CPU if it is to be indexed and synced periodically for all possible travel combination. I decided to take the CPU route and go the indexing route later, if required.
But, Google Webmaster informed me that even without the planned feature I was already very slow compared to a majority of the websites out on the internet.
So, using PageSpeed, I looked for the culprits.
So, I set about fixing the issues..
- I first removed unused CSS and JS, reduced their size and embedded them within the web page – 2 lesser requests to the server and reduced bandwidth.
- Enabled memcache of full web-pages – this was useful, because for each page being loaded, Mediapartners-Google,gzip(gfe),gzip(gfe) (Adsense) was making a request for the same page again within a few milliseconds.
- Next, I removed AddThis and replaced it my own sharing code and icon with just Twitter, Facebook and Delicious links. This would mean limited sharing options and no sharing stats, but I felt it was OK.
- Removed StatCounter code from the main pages (routes for locality and route details pages) – now on, it will not be possible to easily see the sequence of pages visited, for recent visitors.
- Reduced the number of Google AdSense ads from a maximum of 3 per page to just 1 – possibly lesser revenue from ads.
- Increased the expiration time for static resources to 40 days – when those resources are to be changed, I will have to rename them to serve the latest files.
- Delayed initializing and loading Google Map images, until the route details are requested – much better experience on slower connections and less cluttered look initially.
As a result, the page loading time came down a lot. Google Webmaster was quick to identify the changes in Page loading time (which was now approximately 30% of the original value) and the Kilobytes downloaded per day came down to 25% of original values, though the Pages crawled per day had actually increased a little during this time, as shown in the image below..
While I also added a new “find hopping/switching-point” feature, which did increase the usefulness of the website, I believe the page speed alone was responsible for better traffic (approximately 50% higher now) after these changes..
The reduced number of Adsense ads per page, down from 3 to just 1 per page, currently has a negative effect on the ad revenue, but not on the same magnitude. I believe it will grow better again with increased traffic. Apart from coming up higher for popular keywords, now more people are searching for variations of “metrocommute”. Which means they remember and recall the name of the useful website, which they had visited sometime earlier. Better brand recall, can mean letting go of Adsense and possibly direct CPM ads related to local travel services.
Some other options I did not look into, for improving the page speed are : Asynchronous tracking in Google Analytics, which I may take up later and reducing the actual page size (stripping out spaces, etc.,) – because the typical web page size is already very small, not even big enough to trigger gzip on Google App Engine.
Hope this post encourages you to look into making your website faster. Feel free to share your tips as comments.
Maintaining MetroCommute.in is more of a fun-project for me, while I work on iFreeTools, offering a free CRM app and an Online Database Application Builder over Google App Engine. You can reach me at email@example.com.