Yireo - Extensions, tutorials and blog for Magento and Joomla!

Blog Tags

MageBridge Standard

MageBridge hidden features: Google API

Wednesday, 13 October 2010

With MageBridge we have already introduced so many enhancements to Magento, that we sometimes lack the time to explain actually what is impossible. The usage of the Google API is one of these hidden features. Let's see what it is and how it works.

The concept of a CDN

When trying to improve the speed of your site, there are various things you can do: You can speed up your application by enabling caching, you can compress images and enable GZip or mod_deflate. The tricks are in general divided in two groups: To optimize the speed between webserver and browser, and to increase the speed of your actual site.The speed between webserver and browser includes tricks like limiting the bandwidth being used (make your files smaller) but also the geographical location of the webserver.

The geographical location of the webserver is important because it determines the distance between the webserver and the visitor (the browser). If your visitors are located solely in the USA, it is vital to place your webserver in the USA. But if your visitors are spread throughout the world (Europe, USA, Asia) than you might need webpresence in all countries. This is what a CDN does: A CDN (Content Delivery Network) allows static content (stylesheets, images, JavaScript) to be served through a network of webservers, while the logic of CDN tries to use the webserver that is closest to the physical location of the visitor.

A CDN is closely related to cloud hosting: When we talk about a CDN, we generally refer to a network serving static files. Cloud hosting also makes it possible to run dynamic files (like PHP applications).

The CDN of Google ... in MageBridge

Google uses it's own CDN as well, but part of this CDN is also made available for public use: It's commonly referred to as the Google API, but it is actually a CDN serving common JavaScript libraries like MooTools, jQuery and ProtoType. Magento is using ProtoType as JavaScript framework, so every Magento webshop also loads ProtoType to every visitor.

Various Magento forum-threads tell you how to modify the Magento XML-layout to use the Google API for serving ProtoType instead. It's a common trick when dealing with Magento performance. The feature that MageBridge gives you is that you can enable this behaviour not by modifying code, but just by enabling it with a mouse-click. It couldn't be easier.

Is it working?

In most situations, using the Google API in MageBridge makes your site go faster. But sometimes the Google CDN might be slower than your hosting environment. So while the Google API could be applied to MageBridge with a mouse-click, you probably need to do the performance testing yourself to see if it makes your shop run faster.

Tags: magebridge

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo