To begin with, for people who are not familiar with CDN.
What is CDN ? (Wikipedia definition) A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance. CDNs serve a large fraction of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on-demand streaming media, and social networks.
There are many ways to serve static assets for your awesome cool website. You can buy a CDN, host it on a costly hosting service, use github pages or just use google app engine and take advantage of the cloud storage.
Since google appengine works on
PHP (Expiremantal) and
go (Expiremantal) programming language, make sure that any one of those works on you machine.
Download the Google App Engine SDK from the following URL that suits your Operating system https://developers.google.com/appengine/downloads After downloading install app engine sdk on you machine.
Sign up for Google App Engine at https://appengine.google.com. For this you need a Google account (your GMail address for example, if you dont have one it is free to create one)
Create a new app engine application by clicking on the
Create new Applicaiton button on the landing screen.
Create a static html project, you can use the html5 boilerplate or any other front-end seed project that you like. In my case I created the folders and files maually. Add a file and name it as
app.yaml, now this make your app-engine project complete.
Open up the project in your favorite editor and copy paste pastes the following snipped.
Now upload image files to images folder and any other resources to files folder. You can create any number of folder and make sure you mention that folder path as a
static_dir in app.yaml file.
Once you completed copying all the static file, now we need to deploy to the google cloud. The easiest way is to use the
GoogleAppEngineLauncher which will be come with the SDK. Add a project to the launcher by clicking on the
+ button. Alternatly you can just drag and drop the project folder on to the Launcher.
Select a project and click on run to test your project locally. If you feel everything works fine click on the
Deploy button to deploy the application. Give your Google account user name and password and sign in. or you can fire up the terminal and cd to the project directory and use this command
appcfg.py update .
Once the deployment is successful you can access your static files like this http:// < app name >.appspot.com/images/brand.png
Though, Google Appengine is awesome there are some limitations for the free accounts