How To Serve Amazon S3 Images Via CloudFlare CDN

Amazon S3 is a cloud file storage. i personally use it to store this blog images and some of my personal files. Amazon s3 work hand in hand with Amazon Cloudfront, since i was using Cloudflare free CDN, i needed to serve images from my S3 bucket via CloudFlare at a much higher speed with lower latency.

Before this can be possible, you need to have re-written your Amazon s3 URL to a subdomain by creating a CNAME record in your CloudFlare website DNS Zone.
Follow the steps below to learn how to serve s3 images via CloudFlare CDN.

  • Login to your Cloudflare and navigate to your website DNS Settings
    cloudflare DNS settings
  • Create a CNAME record pointing to your amazon bucket name. Guide on how to brand amazon s3 url to your sub domain can be found here.
    Below image is how i changed my s3 URL to “w3guy.com” by setting up a CNAME in my cloudflare DNS zone.
    CloudFlare CNAME record
  • To serve the image through CloudFlare CDN, click the cloud symbol as shown in the image below to accelerate traffic and serve s3 images via CloudFlare.
    CloudFlare accelerate icon
  • On clicking, the symbol will change to the image below, which signifies cloudflare is now activated to serve your Amazon s3 images.
    CloudFlare activated
Don’t miss out!
Subscribe to My Newsletter
Invalid email address