Introduction
The Fastly Content Delivery Network allows you to cache your data using multiple servers across the world, dramatically reducing the amount of latency involved with accessing it. In this article, we will be going over the steps involved with setting up Fastly CDN as a front end for your public B2 bucket.
Guide
Creating your B2 bucket
- Create a public bucket on your Backblaze account. In this case, we are naming the bucket myb2content
- In this particular demo, I have uploaded a jpeg resource named iris-8.jpeg into my newly created bucket. Take note of the S3 URL field.
Configuring your Fastly service
- If you already have a domain name configured, type in the domain name. If not, you can configure your own that will at least temporarily (until the domain is registered) be addressable at the following address.
<domain>.global.prod.fastly.net
In this demo, I will be naming my website www.b2fastlycdn.com - Under Origins -> Hosts, create a new host with the hostname you gathered earlier from your bucket.
In this scenario using the S3 URL, our hostname will be the URL past the bucket name.
s3.us-west-000.backblazeb2.com - Press the pencil icon next to the hostname to edit the parameters of the host. Here we make sure Certificate Hostname, and SNI Hostname is the same as our base address.
Then we set the Override Host to the full S3 URL we gathered above including specifically the bucket name.
myb2content.s3.us-west-000.backblazeb2.com - Update the host and now you should be able to activate the service. You should now be able to navigate to any object stored in your b2 bucket by appending its path to your domain name.
For example, navigating to b2fastlycdn.com.global.prod.fastly.net/iris-8.jpeg will display the jpeg picture of a car.
For more details on different approaches to setting up your Fastly CDN including instructions on how to set it up against a private bucket please visit their documentation.
Articles in this section
- Object Lock FAQs
- Delivering Private Backblaze B2 Content Through Cloudflare CDN
- Bunny Integration Quick Start Guide
- Guide for using Fastly Compute @ Edge with Backblaze B2
- SSE Command Line and API Examples
- Does the B2 S3 Compatible API support Pre-Signed URLs?
- How to use Fastly CDN with B2
- Using the AWS SDK for Java (v2) with B2
- How to use the AWS SDK for Python with B2.
- Using the AWS SDK for PHP with Backblaze B2 Cloud Storage