How it works
You point your site's address at the CDN. The first time someone in Tokyo asks for logo.png, the Tokyo edge has no copy. It fetches the file from your origin, sends it to the visitor and keeps a copy. The next visitor nearby gets the copy straight away, and the origin is not asked at all.
The first case is a cache miss, the second a cache hit. The share of hits is what makes a CDN worth having: the more requests end at the edge, the less work lands on your server.
Who decides how long a copy lives
You do, with a header on every response from your origin. The edge reads it and keeps the file only as long as you allow.
| Header | What it tells the cache |
|---|---|
Cache-Control: max-age=N | max-age=N: the response stays fresh for N seconds after it was generated |
Cache-Control: s-maxage=N | s-maxage: how long a shared cache, such as a CDN, may keep the response; it overrides max-age for shared caches |
Cache-Control: immutable | immutable: the response will not change while it is fresh |
Cache-Control: no-store | no-store: no cache of any kind may store the response |
Age | Age header: the time since the response was generated |
$ curl -sI https://example.com/logo.png HTTP/2 200 cache-control: public, max-age=86400 age: 3120
Here the copy was made 3,120 seconds ago and stays fresh for 86,400. The edge will not ask the origin again for another 83,280 seconds. Change the file and the visitor still sees the old one until the copy expires, so give changed files a new name (logo-v2.png) or a short max-age.
What a CDN keeps, and what it should not
| Good for a CDN | Keep off it | |
|---|---|---|
| Files | Images, CSS, JavaScript, fonts, video, downloads | Files that differ for each user |
| Pages | Landing pages, docs, a blog: the same for everyone | A dashboard, a cart, an account page |
| API answers | Public data that changes slowly | Anything private, or with a login cookie |
| Header to send | public, max-age=… | no-store |
A shared cache stores what it is given. If a private page goes out without no-store, the next visitor can get it. Check the headers of every page that shows personal data.
Do you need one?
Take a CDN when
- Visitors come from many countries. The distance to your server is what makes the page slow.
- You serve big files. Video, images and downloads cost your server traffic and time.
- Traffic comes in spikes. A post goes viral and one small server would stall.
Skip it when
- All visitors are near your server. A bot, an internal tool or a local shop gains little.
- Every page is personal. Nothing is the same for two users, so there is nothing to copy.
- It is a small static site. A static host usually settles this for you.
A CDN does not replace a server. It sits in front of one. The files still have to live somewhere: on a VPS, in S3 object storage or on a static host.
Static sites in Uno
Uno publishes static site from a folder to a public https address, free, on uno4.me. Put a password on it if it is not for everyone, and add a form without a backend. Uno hosts the published copy, so a static site stays up while your computer sleeps.
Sites: free
What this page does not say
- It explains CDNs in general. It does not describe how any one host delivers files, Uno included. Ask a host whether it uses a CDN before you count on one.
- A CDN speeds up files that can be copied. It does not make a slow database query or a slow script on your server any faster.
Need a server behind your site?
The site is free. When you need server code, a database or a bot, a computer starts at the price below.
Small
A Telegram bot, a VPN, a small backend
$5/ month
- 1 vCPU · 1 GB
- 15 GB disk
- 25 GB cloud storage
- 5 boosts a month
Plus
Agents that work with your laptop closed
$20/ month
- 4 vCPU · 4 GB
- 40 GB disk
- 100 GB cloud storage
- Uno Work in the cloud
Pro
A product in production, a second MacBook
$70/ month
- 16 vCPU · 16 GB
- 120 GB disk
- 300 GB cloud storage
- Speed of a MacBook Air M4
Max
A team and many agents at once
$200/ month
- 32 vCPU · 48 GB
- 300 GB disk
- 1,024 GB cloud storage
- 5 public IPv4
Add Uno AI to any plan: 40 h of AI work a month on Small, 100 h on Plus, unlimited on Max. Today: GLM-5.3 Flash and MiMo v2.6 Pro. Or sign in with your own Claude or ChatGPT.
Questions
Is a CDN the same as hosting?
Does a CDN make my site safer?
How do I clear a stale copy?
max-age to run out, or use the purge option of your CDN. For files that change, a new file name (app.v2.js) avoids the problem.