Caching
The Cache-Control header is built for every delivery from the bucket policy, the folder
policy and the lifetime of the file itself.
Visibility
visibility |
Name | Cache-Control |
Who caches |
|---|---|---|---|
1 |
SHARED |
public, max-age=…, immutable |
the browser and the CDN |
2 |
PRIVATE |
private, max-age=… |
the browser only |
3 |
NO_STORE |
no-store |
no one |
Where the values come from
- Folder
If the folder has its own policy (
PATCH /v1/folders/{name}/cache), that one is used. - Bucket
Otherwise — the bucket policy, set in the panel.
- Environment
If
max-ageis set nowhere —CACHE_DEFAULT_MAX_AGE(86400) forSHAREDandCACHE_PRIVATE_MAX_AGE(0) forPRIVATE.
Rules on top
- A non-public file and the
/p,/tchannels — never abovePRIVATE: such a response must not end up in a shared CDN cache. max-ageno longer than the lifetime. If the file has a retention period or the delivery goes through a temporary link,max-ageis cut down to the time left.max-age=0becomesmax-age=0, must-revalidate— the cache must ask again, andETagmakes such a request cheap (304).
immutable
The content at an address never changes — a new version gets a new id. That is why a large
max-age is safe for SHARED: immutable also spares repeated revalidation.