In a previous post (Overdue Updates) I mentioned working through some issues to help increase speed. Of all the minor tweaks I did, I found the root causes of speed issues which were two-fold:
- Web Service Calls
- Generating SEO Friendly URLs
Thankfully, there was a way to help alleviate both problems with one solution, Cache. I built caching functions into this Used Boats Ahoy!, but due to feed changes, they were not working exactly as intended.
- Original Process (No Cache)
- Page Request►Web Service Call►Process Feed►Display
- Original Process (WithCache)
- Page Request►Read Cache►Web Service Call*►Write Cache*►Process Data►Display Data
- New Process
- Page Request►Read Cache►Web Service Call*►Process Data*►Write Cache*►Display Data
* If needed
With this new process, the server will only have to call the Web Service and process the majority of the data only if the cache is out of date, or doesn’t exist yet. Where many pages were taking 2 seconds to load previously, now take 0.3 seconds if being called from the cache.
This has happened to me a couple times, still more than I would like to admit. First off, I used to have my apache logs named the same as the website URL (“bodhidevelopment.com”). This is a pretty minor problem and can go unnoticed for years… until your server runs out of storage space. Apache2 has a nice little feature to rotate logs, but the default will only look for files with the “.log” extension. I used to regularly have log files that were over a gigabyte, and I could only imagine what kind of performance issues that might cause.
I never really paid attention to PHP warnings/errors unless they were causing serious problems, but it felt like the next logical step after getting the logs in order. A large potion of warnings were just undefined variables being used, which is extremely easy to fix, and can add up fast if there are a large number of variables/loops on a page. This gave me the opportunity to look through code that hasn’t been touched for years.
Over the last few weeks I have been performing some much needed maintenance on the Used Boats Ahoy! website. I originally had much more ambitious plans for this website, but I decided to start with an interim solution.
Used Boats Ahoy! is built on top of Joomla 1.5, which has become obsolete by a few versions. I began researching on how to bring it up to version, but unfortunately there are currently too many ties to deprecated APIs to upgrade. This led me to starting a fresh branch which will eventually replace the current project. I decided for the time being, updating the current project made the most sense.
- SEO updates to URL rewriting
- Update link exchange pages
- PageSpeed improvements
- Google Adsense script loading asynchronously
- FaceBook API loading asynchronously
- Boat Search “Modify Search” populates search criteria
- Formatting fixes
This was one of the languages I was never very keen on working with, but I will not pass up on a good opportunity. I’m in an interesting position where I am working on stand alone project which is loosely coupled with other related projects. This means I’ll be using shared libraries and standards, but I have to read through other projects to learn how to use them.
In a previous post, I’ve been using Google’s PageSpeed Insights for a while to help optimize the page loads of my websites for a while now, but I’ve never gone so far as installing the Apache mod_pagespeed plugin. But after trying a few different Joomla extensions, I figured this one might be more efficient by optimizing directly through the Apache layer.
mod_pagespeed is an open-source Apache module that automatically optimizes web pages and resources on them. Optimization is done by rewriting the resources using filters that implement web performance best practices. Webmasters and web developers can use mod_pagespeed to improve the performance of their web pages when serving content with the Apache HTTP Server.
After having good luck with this plugin on Used Boats Ahoy!, I enabled it on my other websites. Below are the changes in PageSpeed score.
Bodhi Development: 70 to 92
Stat Addict: 74 to 90
Washington State Used Boats: 85 to 92
Quality Used Boats: 88 to 93
Bodhi Sanctum: 72 to 76
Used Boats Ahoy: 88 to 94
I’ve been hosting a VPS through Linode for the last couple of years, and I’ve have a great experience so far. A VPS provides the full root server experience without having to worry about the hardware. I was going through my server configurations, and realized I was running a deprecated Linux Kernal 2.6. A host like Linode makes it extremely easy to change kernels on a VPS with a simple web interface with a dropdown menu to select from a prepolulated list of kernels. From an issue in May of last year, I was recommended to use a more stable version (220.127.116.11) which was still selected. I’m hoping any issues I experienced have been resolved since then.
While there are no significant changes, there rare plenty of random fixes and driver updates, updating the revision to 3.0 was a huge milestone for Linus and Linux. As of today Linux 3.4 has been released, which I hope to be able to look in to taking the additional leap.
In my previous post about Used Boats Ahoy! I mentioned a Joomla plugin Mobile Joomla! and how it can detect mobile devices and display the website accordingly without having to redirect to a subdomain (though to access it anywhere, this URL can be used http://i.usedboatsahoy.com/).
Unfortunately since I don’t have complete control of how things are displayed due to the nature of the services I’m using, I’ve had to resort to complex CSS, and other creative solutions. It’s proven a little more difficult than I expected to format everything just right, but even so the mobile experience is much better now than it was before. By getting back into the code for this website, I felt it was an ideal time to look into other ways to boost my site performance.
Read more »
Web services are one of the easiest ways ways to communicate between multiple languages or multiple servers by passing HTTP requests, or XML/JSON. With the recent surge in HTML5, more web sites than ever can use web service requests to deliver updated content without requiring the user to refresh their browser. One of the most widely used web service protocols is SOAP.
SOAP is the protocol that Used Boats Ahoy! uses to populate it’s inventory of boats. The web service client connects to a web service server that has direct access to a database. Interoperability is key with web services since the code base of any given web site is unknown. In this case the client code is written in PHP and the server in ColdFusion, but they both communicate using a common XML format. Read more »
One web site can become much more useful to a user if it has access to other useful sets of information to display. The challenge is to be able to control the flow of information being passed between server and client interfaces. There are many different types of use cases for web services which have different sets of requirements. While RSS feeds are more of a precursor to the proper web service, they are a good example of a one way service where a client can display content, usually articles, from an external server’s database.
Read more »
The site UsedBoatsAhoy! is probably my most popular project to date which hasn’t required much major attention in a little while. The latest features I’ve added were first the Facebook like/share buttons, and then the Google +1 button.
With the current trends of smartphones though, this seems to be changing. This site was not built with the mobile web in mind (although it’s not usable). This is a trend that I can no longer ignore, since over the last two years, mobile traffic has been doubling. Read more »