Skip to main content

AWS CloudFront

Filebase ships with its own global CDN, so most workloads don't need an additional CDN layer. But if you have specific reasons to use AWS CloudFront — Lambda@Edge functions, integration with existing AWS infrastructure, granular cache rules — Filebase works as a CloudFront origin.

When this is the right choice

  • You already have CloudFront distributions and want a uniform edge layer.
  • You need Lambda@Edge or CloudFront Functions for request rewriting, A/B testing, or auth.
  • You want to use AWS WAF in front of your bucket.

For straight static-asset delivery, the built-in Filebase CDN is sufficient and saves a hop.

Create the distribution

  1. In the AWS Console, open CloudFront → Create distribution.
  2. Origin domain: enter your bucket's Filebase URL: <bucket-name>.s3.filebase.io.
  3. Origin protocol policy: HTTPS only.
  4. Origin access: leave as Public — Filebase doesn't have an OAC equivalent for AWS-managed origin access. Use a public bucket and rely on bucket-level access control.
  5. Configure Cache behaviors as you would for any other origin — set TTLs, headers, cookies.
  6. Set Alternate domain names (CNAMEs) if serving via your own domain.
  7. Issue/import a TLS cert via ACM.
  8. Click Create distribution.

Cache-Control coordination

CloudFront respects Cache-Control headers from the origin. Set them at upload time on Filebase to coordinate behavior:

aws --endpoint https://s3.filebase.io s3 cp ./style.css s3://my-bucket/ \
--cache-control "public, max-age=31536000, immutable"

Egress

CloudFront → end-user egress is billed by AWS at AWS rates. Filebase → CloudFront origin egress is free of charge on Filebase's side.

What's next