Skip to content

CDN and caching

How public and private files are cached, and how a change reaches visitors.

Applies to EngineCloud
View as Markdown
FileCached whereFor how long
public fileat the edge, shared by everyonethe bucket’s cacheControl, 1 hour by default
public image transformat the edge30 days, keyed by the options
private file by signed URLat the edge, for that URL onlyuntil the URL expires
private file by tokennot cached at the edge—

Replacing a file (upsert) invalidates its cached copies and its transforms. Clients that cache harder should use paths with a version (menu/v3/pan.jpg).

Range requests (Range: bytes=…) are supported, so video players can seek. ETag and If-None-Match make repeat requests cheap.

Your own address

Public files and image transforms are served on <ref>.files.sypnia.app from the start. To serve them on your own domain, connect an address with Sypnia Domains:

Terminal
npx @sypnia/domains connect cdn.laespiga.co files:public

Domains writes the record and the certificate, and the same files answer on https://cdn.laespiga.co/menu/pan.jpg. Signed links can use the address too; the Files API stays on its own host. Use a subdomain made only for files, never the one your app runs on, so an uploaded file can never read your app’s cookies. A domain registered somewhere else connects the same way once Domains keeps its DNS (DNS only).

    Search pages, sections and terms