Skip to main content

CDN and caching

Filebase operates its own global content delivery network. Every public-bucket request is served through edge locations close to your users — popular objects come back from cache in milliseconds, and origin reads to the underlying object store stay rare even under heavy load.

How it works

When a client requests a public-bucket object:

  1. The request lands at the nearest edge location.
  2. If the edge has a fresh copy, it returns immediately. The origin is not contacted.
  3. If the edge doesn't have a copy (cache miss), it fetches from the origin, returns to the client, and caches the response for subsequent requests.
  4. Cached objects are evicted on a least-recently-used basis as new content replaces them.

This is transparent to your code. Your application uploads via the S3 API; readers see CDN-accelerated responses without any extra configuration.

What gets cached

  • Public bucket objects — yes, aggressively.
  • Private bucket objects accessed via the S3 API — no. Authenticated requests bypass the edge cache and hit the origin every time.
  • Pre-signed URL responses — vary; the cache key includes the signature, so distinct pre-signed URLs for the same object are cached separately. For high-traffic distribution prefer a public bucket.

Cache headers

Filebase respects standard HTTP caching headers on objects you upload:

  • Cache-Control — sets max-age and revalidation behavior. Recommended for static assets:
    Cache-Control: public, max-age=31536000, immutable
    for hashed filenames, or:
    Cache-Control: public, max-age=300
    for content that may change.
  • Content-Type — affects content-encoding negotiation at the edge.
  • Content-Encoding — Filebase does not transcode; if you serve gzip or Brotli, set this header at upload time.

Set headers when uploading:

AWS CLI
aws --endpoint https://s3.filebase.io s3 cp index.html s3://my-site/ \
--content-type "text/html" \
--cache-control "public, max-age=300"
AWS SDK v3
await s3.send(new PutObjectCommand({
Bucket: 'my-site',
Key: 'index.html',
Body: html,
ContentType: 'text/html',
CacheControl: 'public, max-age=300',
}));

Invalidating cached content

Today, the simplest way to invalidate an object at the edge is to upload a new version under the same key — Filebase invalidates the edge cache when an object is overwritten.

For workflows that absolutely require atomic deploys with cache busting, use content-hashed filenames (assets/app.a3f9d2.js) and reference the hash from your HTML. This is the same pattern most modern build tools (Vite, webpack, esbuild) apply by default.

CORS and the CDN

CORS preflight responses are cached at the edge per the rules in your bucket's CORS configuration. See configure CORS.

Bandwidth

Outbound bandwidth from the CDN is free of charge on every paid plan. Bandwidth limits on the free tier are described in the pricing page.

What's next