When thinking about overall website performance, speed is key. There are a lot of ways to improve your website and application speed.
One way to optimize your website is by making it static. With a Cloud Files account, you can create a static website by using a CDN-enabled storage container. Your website can be hosted entirely from Cloud Files, without needing any servers. Hosting a static website on Cloud Files and the Akamai CDN gives your website incredibly quick load times and increases website reliability.
See It In Action
Rackspace’s Hart Hoover used this approach for the Rackspace DevOps blog, transitioning the site from Cloud Servers to Cloud Files. In his words, the solution was “stupid easy and extremely scalable.”
How To Implement
To create a static website using Cloud Files, start by creating a CDN-enabled storage container. Any HTML or static web pages in the container will become available through a static website once you set the X-Container-Meta-Web-Index header to index.html or other index page of your choice. You may also create subdirectories in your website by creating pseudo-directories, as outlined in the pseudo directory section of this guide. Each pseudo-directory becomes a subdirectory in the website.
Note: The page you set for X-Container-Meta-Web-Index becomes the index page for every subdirectory in your website; each pseudo-directory should contain a file with that name. So, if you set X-Container-Meta-Web-Index to index.html, you should have an index.html page in each pseudo-directory. If you do not have the named index page, visits to myhost/subdir/ will return a 404 error.
- Upload your pages to a container.
- POST the X-Container-Meta-Web-Index on the storage container to set the index or other primary page of your website. You must write your storage URL and the container name to properly point to the container (<storage URL><container name>)
- CDN-enable your container.
- Go to your domain host and set up a CNAME to your CDN URL.
Visit the Open Cloud Community, where we have set up a thread on this topic to answer any questions you have.