Google has its own CDN

Google CDN - Turbo for your website - Part 1

The willingness to then click through other pages of the project decreases. Content delivery networks are a very good way to minimize waiting times for your visitors. In this article you can learn how to use Google's in-house CDN (Content Delivery Network) as a turbo for your website.

CD ... what?

Imagine going to get rolls in the morning. There are five chain bakeries in your city. So all rolls taste equally good. Which one are you going to? Unless you happen to be a fan of long morning walks, you will likely pick the one that is closest to you. This is exactly the principle of content delivery networks. A server has the original and current content. Other servers around the world get their data from this server. They mirror these and ask at regular intervals whether there are new or updated files. The website visitor automatically obtains the data from the server that is closest to his or her location.

Illustration 1: How the content delivery network works

Another speed increase is generated by the high-performance servers of the CDN providers.

This article deals in particular with the possibility of using the Google server structures. Standard web hosts do not have the appropriate hardware resources to provide a speed comparable to that of the Google server.

Which data should be made available in the CDN?

Static files can be made available in content delivery networks. For example CSS and JavaScript files or images. As soon as these have been uploaded to the server network, they can be obtained from there in HTML files.

Figure 2: Example integration into the source code

Not all image files should be made available in the CDN. For example, large background images or any images related to the design are recommended. Leave images that belong to the content of your website on your own server. After all, you want to appear at the top of the image search results.

How much does it cost to use the Google Content Delivery Network

The use of this Google service is free for up to five million views per month. Additional inquiries are billed either by the hour or by gigabyte. However, the costs for this are only in the cent range. Further information can be found in the price table.

Google CDN - registration and setup step-by-step

Ready? Because now it's time to get down to business! The registration takes place via the Google App Engine. There you have to log in with your Google account. There click on the button “Create Application”.

Figure 3: Home Google App Engine

In the next step you have to create your application. First choose a name. This name will also be available as a subdomain of AppSpot.com (yourname.appspot.com). Choosing the name can take a while, because creativity is required here. Each name can only exist once and you will quickly notice that there were already one here before you :) In the next field you have to assign a title for your app. In our case, nobody will see this title, as you will only use the application as storage space for the static files of your website. Now confirm that you agree to the terms of use by ticking the box accordingly. Now you can click on the “Create Application” button again.

Figure 4: Installation of a Google app

That was the first trick and the second follows at the same time. Your application has now been created successfully. You now have the option to view the dashboard and register new administrators for your storage space.

Figure 5: Successful registration of a Google app

First of all, however, it is important that you can also upload files. This is only possible with the GoogleAppEngineLaunchen, which is of course provided free of charge by Google. To do this, go to the download page and download the appropriate software for your operating system. Open the program and install it on your computer. Then click on “File -> New Application”. Enter the previously defined unique name of your app in the Application ID field. Under Application Directory you can specify the folder on your computer in which the files that are to be uploaded are located. Then click on the “Create” button.

Figure 6: Setup of a new app in the GoogleAppEngineLauncher

Three system files are now automatically created in the folder you specified and a favicon is stored.

Figure 7: System files GoogleAppEngineLauncher

Each new folder that you want to release for synchronization must now be registered and stored once in the “app.yaml” file.

To do this, open the file in a text editor. In our example we have now registered three folders:

As you can see, all you need to register a new folder is two lines of code that are self-explanatory.

Figure 8: Registration of new folders in the app.yaml.

You are now ready to synchronize your files for the first time. Simply add your files to the appropriate folder and then click on “Deploy” in the GoogleAppEngineLauncher. Now the console view of your computer opens and you can see how the files are uploaded to the server.

Figure 9: Console view of the GoogleAppEngineLauncher

Congrats, it's done!

Now change the referencing of the files in the source code of your website, as shown in Figure 1, that you have now moved to the super-fast Google server.

Bonus tip: chip tuning for your website

So-called JavaScript libraries are used more and more frequently in modern websites. jQuery, for example, might have been heard by one or the other. Google makes these web standards available on their server for free use. You can find all supported files at Google Hosted Libraries. Find out which of these files are used on your website and change the reference to the corresponding storage space on Google. The advantage here is that a lot of websites use these files. If a visitor has already visited a website that also receives the jQuery file from the Google server, the file is already in the user's browser cache. This means that your website will load even faster.

Happy visitors make happy webmasters

If your visitors are happy, you as a website operator will be happy too. The loading time plays an important role here. Because fast websites not only show Google that they are dealing with a professional, but also the visitors. Thus, website performance also plays a role in gaining trust and increases the length of stay and, if necessary, improves conversion rates. In the next week you can go even further into the subject of content delivery networks in an article for advanced users. The motto is even more speed for your website ;-)