How to speedup static website using DigitalOcean Spaces?

Web Hosting

Gone are the days where we patiently wait to see the website loading.

A website that loads instantly will definitely grab more visitors than a slow website.

Web Hosting

Luckily, in DigitalOcean Droplets, moving static web content like images to object storage is one of the ways to improve website response time.

At Bobcares, we often get requests from cloud customers to fix their slow websites as part of our Managed Cloud Services.

Today, we’;ll see how our Cloud Engineers speedup static website using DigitalOcean Spaces.


How does static files affect response time?

Websites will have static content as well as dynamic contents. The html files, images, etc. belong to the static content and they are shown on the website as it is.

But, that is not the case with dynamic files. They need processing and depends on the user input as well.

A web server handling both static and dynamic content together can easily get overloaded. This further can cause the application to fail.

That’;s why, our Cloud Engineers often suggest to offload the static content to object storage. This will help web server to process only the dynamic requests.


How can DigitalOcean Spaces help?

Now, we’;ll see how we can make use of Spaces to speedup the website.

DigitalOcean Spaces allows storage of large amounts of data. The features of even the smallest plan include 250GB of data storage, 1TB of outbound traffic and so on.

Similarly, Spaces support CDN (Content Delivery Network) that helps to process data fastly.

To improve the response time, our Cloud Engineers move all the static files to the storage space. And, all the static file request will be served by the Spaces. Thus, the web server will have more free resources as it has to process only dynamic requests.

Additionally, moving static content to object storage helps in the centralization of data. Adding any new content to object storage makes it instantly available to all the applications.

To make the static website files load from the DigitalOcean Spaces, our Cloud Engineers set up Nginx to proxy requests for objects on the Space storage.

Here, Nginx will receive web requests from the visitors and pass them along to the Spaces service, which will send the results back through Nginx.


Failure points and their fixes

Although, using Spaces helps in website optimization, we often see customers reporting problems too. Let’;s check them in detail.


1. Language support

Unfortunately, DigitalOcean Spaces support only two languages- Python and GO. The lack of in-built support for PHP causes problems for web developers.

Here, our Support Engineers recommend customers to use existing PHP class or library which can interact with Amazon’s AWS. These libraries are compatible with Digital Ocean’s spaces API too.


2. No support for custom domains

Similarly, Spaces do not support custom domains as of now. But, we often get requests from customer to make static files available under their custom domain name.

For example, a Space url will be of the format And, when the customers would like to mask this, our Cloud Engineers set up a DigitalOcean Droplet as a reverse proxy using Nginx. Here, we pass all the static file requests to the Spaces service and get the files.

[Do you have a slow website? We can speed up your website]



DigitalOcean Spaces is one the ways to store static files. Today, we’;ve seen how our Cloud Engineers speedup website using Spaces, common failure points and their fixes.

The post How to speedup static website using DigitalOcean Spaces? appeared first on Bobcares.