How to use Google Drive as a CDN
Don’t worry, its really not hard to use Google Drive as a CDN. You see I have broken it down to 16 steps but in truth its only half a dozen. I broke it into such small bites just to make it perfectly clear and transparent. It will only take a couple of minutes in realtime. You only have to do it once. There after you just add whatever you need to this one folder. So let’s get started
Google Drive as a CDN
- Login into your Google account. If you use the google chrome browser you may already be logged in.
- Now access Google drive.
- At the top left of the window you will see a “+New” button. Create a new folder.
- Once created, right click on it, from the list of options select Share.
- A Dialog Box will appear. Click on Advanced.
- (Another Dialog Box Will Appear).
- Click on Change in front of Private – Only you can access.
- (Another Dialog Box Will Appear).
- Select First Option On-Public on the web and hit Save Button.
- Now your new folder is effectively a CDN folder and it can accessible without login.
- Upload your files to your new “CDN” folder.
- To use or share files out of google drive you need File ID or shareable link of each file.
- Go to each required selected file (inside the folder)and click on Share (a Dialog Box will Appear).
- Here you can see File ID & sharing link.
- Just Copy That and Use it Wherever you want.
CDN – What is a Content Delivery Network
A Content Delivery Network is a Network of servers.
You subscribe to their CDN network
Each server in that network holds copies of your website files.
The servers are strategically spaced around the world.
Any time someone visits your Domain(website) the CDN serves files from the closest of those servers.
The Problem CDN addresses
Normally your website lives on one server somewhere in the world.
For someone living in the same city as your server, your site may load quite quickly. (but not a guarantee)
The path to your server in the same city is likely quite direct.
If your site content is well optimized and your server reasonably efficient things should be good.
The further people get from that server, then it’s likely your site will load slower.
The path from other locations around the world may go through multiple servers.
Then through regional hubs .
And finally… they can get to your sites hosting server.
Of course the type of hosting service you use may have an impact during busy times of day.
Add to that any congestion that may be experienced anywhere along that path.
The files from your site will take longer to reach the visitors browser.
Here is where a CDN can help offer a solution.
A CDN stores copies of your website information on multiple servers around the world.
This means we could store a large percentage of that data and files on a server closer to the physical locations of our visitors.
The visitors browser will receive the required information quicker to render your website for viewing.
We do not visit a website.
Most people do not know what is actually going on when they visit a website. Mostly they don’t care to know. They only know if a website is fast or slow.
In truth the the technical side has no bearing on their thoughts. They are the consumer of the experience, not the webmaster.
In this respect the commonly used word “visit” is unfortunate because it masks the reality of what is really happening.
We do not visit a website. (the website comes to us)
For those of us that own or manage a website, we need to be very aware of the actual process.
So what actually happens. Read on.
In the same way that we watched a concert on TV, we did not actually go to the concert.
It came to us on our TV screen. Our TV whether cable, satellite or via antenna, picked up a “signal” that contained all the digital data to display the concert. As motion occurs, parts of the screen refresh and change.
We all use web browsers in a similar way to TV channels. Sure its a loose comparison but it works.
We download a batch of digital files. Then our browser builds a representation of a website on our computer screen.
Our website is not a moviehouse or cinema playing our latest smash hit. It is really just a file server. There is no visual representation of our website until someone loads those files in a web browser.
There are two pieces of technology communicating with each other. The files on our hosting server, and the Web browser on someones computer.
Which brings us to our next point
What are the steps of a web page being displayed?
Optimize my website load time.
We all want a fast loading site, but how do we achieve it? What can we do to speed up our website load time.
In a previous post I spoke about the steps it takes to load a website. Here they are again as a reminder.
- A request is made when a link is clicked.
- The page and its resources (files) are downloaded.
- The web browser uses the page resources to build the page.
- The page then is rendered (displayed) to the user.
So where do we start? With the only step we have some control over.
To optimize our website load time we need to address STEP.2
The browser can build nothing until it has the necessary files.
The bigger the files, the slower the transfer, the longer the wait.
We need to optimize our site to keep the data and file size down.
Media files such as Images tend to be one of the major culprits for slow load.
Making sure you format and size media correctly, is critically important. (see my posts on that)
(Getting that Header image onscreen as quick as possible is a priority.)
Generally these are static files. They don’t change once added to your site.
So file size matters, but so does distance, even in the superfast digital world.
Website load time usually gets longer, the further the “visitor” is from the files on your hosting server.
Paying for a CDN (Content Delivery Network) may or may not be in your budget.
It works by having copies of site files on multiple servers geographically spaced.
It is one of the most effective solution to make your website load time quicker for “visitors”.
I love Notepad++ and why you need it
Notepad++ is a must have text editor if you run a website.
It can be used as a replacement for the default Notepad in Windows or used side by side.
This magic little tool understands all the coding languages as well as regular doc format text.
It recognizes .css files, php files etc etc and retains their unique logic and layout. Here is a snippet of a css file opened in Notepad++
Using other text editors tends to lose the logic and readability.
Here is a hypothetical use:-