Storage CDN
Knowing how the Storage cache works tells you why a first request is slower than the next one, and why public buckets cache better than private buckets. For how to remove an object from the cache, see Purge CDN cache.
How caching works
Supabase Storage caches every object you upload on a Content Delivery Network (CDN), to lower latency for users around the world. A CDN is a geographically distributed set of servers or nodes which cache content from an origin server. For Supabase Storage, the origin is the storage server running in the same region as your project. Aside from performance, CDNs also help with security and availability by mitigating Distributed Denial of Service (DDoS) and other application attacks.
For example, take a project in Singapore. Every request to its Storage API goes to the CDN first:
-
A user in the United States requests an object and is routed to the U.S. CDN node. The node doesn't have the object in its cache yet, so it fetches it from the origin server in Singapore.

-
Another user in the United States requests the same object. The U.S. node serves it directly from its cache, without routing the request back to Singapore.

A CDN works similar to a library system. When a branch doesn't have the book you ask for, it orders a copy from the central library, then keeps it on the shelf for the next reader. A CDN node does the same with your objects.
A CDN can still evict your object from its cache if no one in a region has requested it for a while. For example, if no user in the United States requests your object, the U.S. CDN node removes it from its cache, even with a long cache-control duration.
The cf-cache-status response header shows the cache status of each request:
| Status | Meaning |
|---|---|
MISS | The CDN node didn't have the object, so it fetched it from the origin. |
HIT | The CDN node served the object from its cache. |
When you measure cache hits in your logs, STALE, REVALIDATED, and UPDATING also count as hits. For how to query them, see Cache metrics.
Public vs private buckets
Public buckets cache better than private buckets, because Storage checks each user's permissions for objects in a private bucket. The following table compares the two when two users request the same object from the same region:
| Public bucket | Private bucket | |
|---|---|---|
| Authorization | None | Checked for each object and user |
| Result for the first user | Cache miss | Cache miss |
| Result for the next user | Cache hit | Cache miss, because each user can have different security policies |
| Cache hit rate | Higher | Lower |
Related resources
- Purge CDN cache: remove a stale object from the cache.
- Smart CDN: how Storage invalidates cached objects when they change.
- Storage buckets: choose between public and private buckets.