Are you using Amazon S3, Google Cloud Storage, or some other object storage provider to serve your images and other assets? Cloudflare doesn't automatically cache these valuable resources! That's what Cassette is for.
Cassette 🐇 speeds up your site and 💰 saves you money on your object storage provider bill.
You can install it for free and unlock additional features with the Pro plan.
Check out this tutorial to see it in action.
How to Install
Powered by Cloudflare
Cloudflare offers DDoS protection, a global CDN, SSL certificates, and a lot more cool stuff for free. You should probably use it.
Cassette only takes a few minutes to install on your site but additional required configuration is necessary for Cassette to work properly. The installation page covers the basics but we'll cover more here.
The following Options are available for each Object Storage Configuration:
This subdomain is created on your site by Cassette in order to enable Cloudflare to cache your object storage assets. Requests made to this subdomain are routed to
Object Storage Hostname.
This is necessary because Cloudflare can only cache assets on domains you control. For example, Cloudflare can cache assets.yoursite.com/image.png but not yoursite.s3.amazonaws.com/image.png.
Object Storage Hostname
The URL of your Object Storage bucket obtained from your Object Storage Provider. This is probably something like yoursite.s3.amazonaws.com or yoursite.storage.googleapis.com. Requests made to your
Assets Subdomain will be routed here.
OPTIONAL Object Storage Pathname
This option is useful if your Object Storage bucket has a pathname. Otherwise, ignore it. Some buckets are intialized with a path-style URL - like http://storage.googleapis.com/yoursite.
In this case,
Object Storage Pathname would be
Additional Required Configuration
Once you've installed Cassette, there's one more thing you have to do. All the links on your website that point to
Object Storage Hostname should be changed to
Asset Subdomain. Once you've updated your links, ensure Cassette is working by reloading the page and inspecting the cf-cache-status header on requests to
Let's say your Assets Subdomain is assets.yoursite.com and your Object Storage Hostname is yoursite.s3.amazonaws.com and your site contains a cute picture of your cat. The HTML for your cat picture probably looks something like
<img src="https://yoursite.s3.amazonaws.com/mycat.jpg" />. This needs to be updated to
<img src="https://assets.yoursite.com/mycat.jpg" />
Generally, any references to
yoursite.s3.amazonaws.com should be updated to