How to CDN IBM Object Storage with Cloudflare

This is my way to put Cloudflare in front of IBM Object Storage.

Why do I need it?

To reduce the number of hit to the storage. Like AWS S3, each call to get a file is part of the amount of x millions of requests you pay. Another point is to “CDN” (caching) your files using Cloudflare which is a lot more efficient than getting them from a “regional” location.

How to do it?

It takes only 1-2 minutes to set it up and can help to reduce latency, availability and cost.

IBM Cloud

The step after creating the storage is to activate static website.

In addition, you need to add the CORS to authorize your domain(s) to request files to this storage.

static website activated with public url

Cloudflare

DNS entry

You create the CNAME entry and point it to your IBM object storage.

cname entry to IBM object storage

Caching rule

Putting a caching for 1 year on every files. I never change those files so it’s the best setting in my case.

cloudflare caching rule for the subdomain