Hippius CDN
The Hippius CDN serves the objects of one of your S3 buckets from cache nodes close to your visitors. It is open to every account, in the console under CDN in the sidebar.
How it works
A zone is a CDN in front of one bucket, or one folder (prefix) of it. As soon as you create it, the zone is served over HTTPS on its default hostname, ZONE_ID.c.hipcdn.net. You can add your own domains to it.
- Origins. Hippius Object Storage buckets, public or private. Other web servers (HTTP(S) origins) aren't supported yet.
- Regions. Cache nodes serve from France (FR) and Australia (AU). Visitors in Oceania are sent to AU (or to FR if AU has no node up), everyone else to FR. The shield region of a zone is the cache the other regions fill from: pick the one nearest the bucket. FR is the default.
- Limits. 10 zones per account and 20 custom domains per zone. Each cache node serves a zone up to 20,000 requests per second and 2,000 Mbit/s: above that, new requests get
503withRetry-After, and aren't billed.
Create a zone
- Open CDN in the sidebar and click New zone.
- Pick the Bucket. Optionally enter a prefix, a folder such as
public/, to serve only the objects under it. - Give the zone a name, choose the shield region and the monthly spend cap ($20 by default, from $1 to $100,000).
- Create it. The default hostname serves within a few seconds.
A zone in front of a private bucket creates a read-only key on that bucket for the cache nodes, so creating one needs admin access to Object Storage as well as to CDN on a shared account.
With a private bucket, every object under <bucket>/<prefix> becomes publicly readable through the zone. Use a prefix that holds only what you want to publish.
What visitors receive
- HTTPS. Plain HTTP requests are redirected to HTTPS (301), unless you turn that off in the zone's settings.
- GET and HEAD only. Other methods get 405, and so does
OPTIONSunless the zone has a CORS policy. Range requests work. - Content type. Each object is served with the
Content-Typestored in Object Storage. Only when it has none, or a generic one (application/octet-stream), is it guessed from the extension, and only for images, audio, video, fonts, CSS, JavaScript, JSON, WebAssembly and plain text. HTML, SVG and XML are never guessed: upload them with an explicitContent-Type.X-Content-Type-Options: nosniffis always sent. - HTML on the default hostname is sandboxed. On
ZONE_ID.c.hipcdn.net, HTML, SVG and other XML getContent-Security-Policy: sandbox allow-scripts. On your own domains they don't, so serve a website from a custom domain. - CORS only when you turn it on. By default the CDN adds no
Access-Control-*headers, so a page served from another origin can't read the zone's files withfetchor XHR, or load web fonts from it. To allow it, set a CORS policy on the zone (see Allow cross-origin requests (CORS)). On the default hostname, HTML is sandboxed, so even same-host requests count as cross-origin. - Headers passed through from the object:
Content-Type,Content-Length,Content-Range,Content-Encoding,Content-Language,Content-Disposition,ETag,Last-ModifiedandAccept-Ranges.
Objects uploaded from the console keep the file's type, so they are served with it, HTML included. See Uploading objects.
Host a static site or single-page app
A zone can serve a website built to static files (plain HTML, or a React, Vue or Svelte app) straight from its bucket. Set it up in the Static website section of the zone's Settings tab:
- Index document (
index.htmlby default):/and every path ending in/serve that file from the same folder, so/docs/servesdocs/index.html. It is one file name, without/. - Single-page app: serve the index for unknown paths. A path with no object behind it answers
200with the index document instead of a 404, so your app's router handles/profile/42. Server errors (5xx) are never replaced, and the bucket is never listed. - Excluded prefixes (
/assets/by default, up to 16): a missing file under them keeps its 404, so a broken script or image link never gets the HTML page back. Add your build's asset folders, such as/static/.
To publish a site:
- Upload the build output to a bucket (or a folder of it), keeping each file's
Content-Type: HTML is never guessed from the extension (see What visitors receive). A public bucket is fine as the origin of a static site. - Create a zone on it, with the folder as its prefix, such as
build/. - Turn on the index document and, for a single-page app, the fallback.
- Add your own domain: HTML on the default hostname is sandboxed, so serve the site from a custom domain.
- After each deploy, purge what changed, or everything, on the Purge tab.
To publish a new version, purge /index.html (or a prefix that contains it, such as /), not the path / alone. The index document is cached under its object path, so a path purge of / leaves the old /index.html in the cache. The same goes for folders: purge the path /docs/index.html, or the prefix /docs/.
Cache rules on a static-site zone match the object path that is served: the home page matches /index.html, not /.
The zone's Origin section on the same tab changes its bucket or prefix, for example to switch to a new build folder. The whole zone is purged at once, so nothing from the previous origin is served again. Moving to a private bucket needs admin access to Object Storage, as at creation.
Allow cross-origin requests (CORS)
Turn CORS on in the CORS section of the zone's Settings tab when a page on another origin loads the zone's files with fetch or XHR, or loads web fonts from it:
- Allowed origins: up to 32, one per line, each a scheme, a host and an optional port with no path, such as
https://app.example.comorhttp://localhost:3000. Leave out the default port (:443for https,:80for http).https://*.example.comallows exactly one level of subdomain (the*stands for one label, same scheme): it matchesa.example.com, but notexample.comora.b.example.com. Or choose Any origin (*) for public files. - Methods: GET, HEAD or both. The preflight (
OPTIONS) is always answered. - Allowed request headers: headers a page may send beyond the simple ones, such as
range. Exposed response headers: headers a page's script may read, such asetagorcontent-length. Up to 32 each, or*for any. - Preflight cache: how long a browser reuses a preflight answer, from 0 to 86400 seconds (600 by default).
- Allow credentials: for requests sent with cookies or
credentials: "include". It can't be combined with Any origin, or with*as the headers.
With Any origin, every response carries Access-Control-Allow-Origin: *. With listed origins, a request from one of them gets its own origin back, a request from any other origin gets no CORS header, and every response carries Vary: Origin. CORS headers are sent on error responses too. The cache nodes answer preflight requests themselves with 204: each one counts as one request, with no bytes, and counts toward the zone's request limit.
Through the API, send PATCH /api/cdn/zones/ZONE_ID/ with {"cors": {...}} to set a policy, or {"cors": null} to turn CORS off. Each write replaces the whole policy, and keys you leave out take their defaults:
{
"cors": {
"allow_origins": ["https://app.example.com", "https://*.example.org"],
"allow_methods": ["GET", "HEAD"],
"allow_headers": ["range"],
"expose_headers": ["etag"],
"max_age": 600,
"allow_credentials": false
}
}
An invalid policy is refused with 400 and the code invalid_cors, and the response says why.
Use your own domain
On the zone's Hostnames tab, click Add domain and enter the name. The examples below use social.example.com on a zone whose default hostname is ZONE_ID.c.hipcdn.net. The console shows the exact values for your domain, ready to copy.
The three records
| Record | Value | What it does |
|---|---|---|
CNAME social.example.com | ZONE_ID.c.hipcdn.net | Sends visitors to the CDN, and proves you own the name. Creating it switches live traffic to Hippius. |
TXT _hippius-cdn.social.example.com | hippius-cdn-… (your token) | Proves you own the name. Optional for a subdomain (the CNAME proves it too), but it lets you prove ownership, and get the certificate, before you move the CNAME. Required for a bare domain. |
CNAME _acme-challenge.social.example.com | ….dcv.c.hipcdn.net | Required for the HTTPS certificate: it lets Hippius complete the certificate authority's DNS check for your name. |
Either the hostname CNAME or the TXT is enough to prove ownership. Once it is proven and the certificate is issued, the domain is Active and served. It is billed only once its traffic points to the CDN: from the first check that sees the hostname CNAME (for a bare domain, its ALIAS flattened into Hippius CDN addresses) in place. With the TXT alone, the console shows it as verified, with billing starting when traffic points to the CDN. Such a domain is checked again every 10 minutes, so billing starts shortly after you switch the CNAME.
A name can hold a CNAME and nothing else. If social.example.com already has an A, AAAA or CNAME record (for example a CNAME to CloudFront), edit or delete it rather than adding a second one. The same goes for an old _acme-challenge TXT record left by another certificate tool.
- A bare domain (
example.com) needs an ALIAS, ANAME or flattened CNAME record at your DNS provider, and the TXT record. Route 53 can't alias to another provider's name: serve the CDN onwwwand redirect the bare domain to it. - CAA records. Certificates come from Let's Encrypt or Google Trust Services. If your domain or a parent domain has CAA records, they must allow both
letsencrypt.organdpki.goog, or no certificate can be issued. Without CAA records, there is nothing to do. - Wildcard domains (
*.example.com) aren't supported.
Name fields: the part before your domain
Most DNS editors add your domain to whatever you type in the name field. For social.example.com, type only the part before example.com:
| Record | Type in the name field |
|---|---|
| Hostname CNAME | social |
| TXT | _hippius-cdn.social |
| Certificate CNAME | _acme-challenge.social |
Typing the full name in such an editor creates social.example.com.example.com, which never works. The console reads your domain's nameservers to find the zone your provider hosts, and shows the exact name to type next to each record.
Instructions by DNS provider
The console detects your DNS provider from your domain's nameservers and shows its tips. In short:
| Provider | Name field | Notes |
|---|---|---|
| Cloudflare | Relative (_acme-challenge.social) or the full name: both work | Set the proxy status of both CNAME records to DNS only (grey cloud). A proxied (orange cloud) CNAME hides the CDN behind Cloudflare's addresses: the CNAME can't be checked, and visitors reach Cloudflare instead of Hippius. One-click setup is available (see below). |
| Amazon Route 53 | Relative: in Create record, type the part before your domain in Record name (Route 53 shows the domain after it) | A bare domain can't alias to another provider's name: use a www hostname and redirect the bare domain. If the name has an alias record (for example an A alias to CloudFront), delete it, or let one-click setup replace it. One-click setup is available. |
| SiteGround | Relative: in Site Tools > Domain > DNS Zone Editor, pick the record type and type the part before your domain in Name (SiteGround shows the domain after it) | If the hostname already has an A or CNAME record (for example to CloudFront, or to the site itself), delete or edit it first. |
| GoDaddy | Relative: DNS Management > Add New Record, Name is the part before your domain | If a record already exists for the name, edit it instead of adding a second one. |
| OVHcloud | Relative: DNS zone > Add an entry, Sub-domain is the part before your domain | End the CNAME targets with a dot (ZONE_ID.c.hipcdn.net.): without it, OVHcloud appends your domain to the target. |
| Gandi | Relative: DNS records > Add record, Name is the part before your domain | In text (zone file) mode, end the CNAME targets with a dot. |
| Namecheap | Relative: Advanced DNS > Add new record, Host is the part before your domain | |
| IONOS | Relative: Domains & SSL > DNS > Add record, Host name is the part before your domain | |
| Google Cloud DNS | Relative in the console (Add standard: the domain is shown after DNS name) | With gcloud, use the full name with a final dot: _acme-challenge.social.example.com. |
| DigitalOcean | Relative: Networking > Domains, Hostname is the part before your domain | |
| Vercel | Relative: the domain's DNS Records, Name is the part before your domain | |
| Hostinger | Relative: DNS / Nameservers > Manage DNS records, Name is the part before your domain | |
| Porkbun | Relative: DNS Records, Host is the part before your domain (empty for the domain itself) | |
| Other providers | Usually relative | If your editor shows the full name in the field, type the full name instead. |
Checking the records
The domain is checked every minute for the first hour, every 10 minutes for a day, then hourly until 7 days after the first check. On the Hostnames tab, each of the three records has its own line:
- ✓: the record is in place.
- ✗ missing: nothing is published at that name yet.
- ✗ wrong: something else is published there, and the console shows what it found instead, for example a CNAME pointing to
d4x3….cloudfront.net, or address (A) records where a CNAME is expected. - For a bare domain, the ALIAS can't be checked by name (it is flattened into addresses): the TXT record proves it. Once those addresses are all Hippius CDN addresses, the ALIAS shows as in place and billing starts.
Check now checks the domain at once: at most once every 10 seconds per domain, and 30 times a minute per user (it needs CDN operator access on a shared account). Once the DNS is proven, the certificate is issued, provided the _acme-challenge CNAME is in place, and the domain turns Active.
If a domain stops proving ownership (neither the CNAME nor the TXT points at the zone any more), it stops being served and billed. Fixing the DNS within 7 days restores it; billing starts again once its CNAME points to the CDN again. While the TXT stays in place, moving the CNAME elsewhere is not detected and the domain stays billed: remove the domain from the zone when you stop using it.
One-click setup (Cloudflare and Route 53)
If your DNS is at Cloudflare or Route 53, Set up automatically on the Hostnames tab writes the records for you with a credential you paste:
- The credential is used once, during that request, to write the records, then dropped. Hippius never stores it, logs it or shows it back.
- Before writing anything, the existing records at those names are read. If one would be replaced, for example the hostname's CNAME still pointing at CloudFront, the console shows what is there and asks you to confirm Replace. Replacing the hostname's own record switches its live traffic to Hippius. Nothing is written until you confirm.
- Only the verification records writes just the TXT and
_acme-challengerecords and leaves the hostname's record alone, so the certificate is issued while traffic still goes to your current host. The TXT proves ownership, so the domain turns Active, but it isn't billed until you switch the CNAME and its traffic points to the CDN. No reminder tells you to switch it: do it when you are ready. - Other TXT records on
_hippius-cdn.social.example.comare kept. Old Hippius tokens there (hippius-cdn-…) are replaced without asking. Records that are already right are left as they are. - It needs the same access as editing the zone (CDN admin on a shared account), and is limited to 10 times per hour per user.
Cloudflare. Create an API token (My Profile > API Tokens > Create Token) with the permission Zone > DNS > Edit, limited to your domain's zone. Either add Zone > Zone > Read so Hippius can find the zone, or paste the zone's Zone ID (shown on its overview page). The CNAME records are written DNS only. Delete the token once the domain is set up.
Route 53. Prefer a short-lived credential: create a role with the policy below, run aws sts assume-role --role-arn ROLE_ARN --role-session-name hippius-cdn --duration-seconds 900, and paste the access key ID, secret access key and session token it returns. Optionally paste the hosted zone ID. The minimal policy, for social.example.com in hosted zone HOSTED_ZONE_ID:
{
"Version": "2012-10-17",
"Statement": [
{"Effect": "Allow", "Action": "route53:ListHostedZones", "Resource": "*"},
{"Effect": "Allow", "Action": "route53:ListResourceRecordSets",
"Resource": "arn:aws:route53:::hostedzone/HOSTED_ZONE_ID"},
{"Effect": "Allow", "Action": "route53:ChangeResourceRecordSets",
"Resource": "arn:aws:route53:::hostedzone/HOSTED_ZONE_ID",
"Condition": {"ForAllValues:StringEquals": {
"route53:ChangeResourceRecordSetsNormalizedRecordNames": [
"social.example.com", "_hippius-cdn.social.example.com", "_acme-challenge.social.example.com"],
"route53:ChangeResourceRecordSetsRecordTypes": ["CNAME", "TXT", "A", "AAAA"]}}}
]
}
route53:ListHostedZones can be dropped if you paste the hosted zone ID. A and AAAA are only needed to replace an existing alias or address record at the hostname. All the changes are applied as one batch. On Route 53, a bare domain can only get the verification records.
Reminder emails
While a domain's DNS isn't proven, the account owner gets:
| When | |
|---|---|
| 1 day after the first check | Action needed: the records, and what the last check found for each one. |
| 3 days after | Reminder: the same, as last checked. |
| 6 days after | Last reminder: "we stop checking on DATE", 7 days after the first check. |
Each email lists the records not confirmed correct (missing, wrong, or a failed lookup), with what was found instead, and your DNS provider's tips when it was detected. The emails stop as soon as the DNS is proven.
At 7 days the domain turns Failed: it isn't checked automatically any more, isn't served and isn't billed. No email is sent after 8 days. Fix the records and press Check now: it checks at once, and if the DNS still doesn't prove the domain, starts a new week of checks and reminders. Or remove the domain from the zone.
The two reminders respect the email notifications switch in your account settings; the first email is always sent.
Cache rules and purging
By default, a zone caches successful responses (200 and 206) for 1 hour and 404s for 1 minute. Redirects (3xx) and server errors (5xx) aren't cached. Visitors get Cache-Control: public, max-age=3600. The origin's own Cache-Control and Expires are ignored. The query string isn't part of the cache key, and isn't sent to the bucket: a file is cached once per path.
The Cache rules tab holds an ordered list of up to 50 rules. Each rule matches a path prefix, a glob or a list of file extensions, and sets one or more actions: how long the cache keeps a file (edge_ttl, in seconds, or "origin" to follow the object's own Cache-Control or Expires), how long browsers keep it (browser_ttl), which query parameters are part of the cache key, whether to bypass the cache, and whether to ignore Set-Cookie. Rules are evaluated top to bottom and the first match wins, whole: put specific rules first. Click Save rules to save the list.
The Purge tab invalidates what you name on every cache node: paths, folders (prefixes ending in /), or everything. The next request for it is fetched from the origin. A purge usually reaches every node in under a minute. A request names up to 1,000 paths or prefixes. You can purge up to 100 times a minute per zone, and everything once a minute.
Through the API, send POST /api/cdn/zones/ZONE_ID/purge/ with exactly one of {"paths": [...]}, {"prefixes": [...]} or {"all": true}.
Traffic stats
The zone's Stats tab shows what it served over the last 24 hours, 7 days or 30 days: bytes, requests and cache hit ratio, a chart over time, a breakdown by the region of the cache node that answered, responses by status class, the bytes fetched from the bucket, and the requests refused and not billed (such as those of a paused zone). Traffic shows there within a few minutes.
Prices
The CDN is billed by the hour from your balance, like Compute. Nothing is free: billing starts at the first byte.
| What | Price |
|---|---|
| Data billed in FR | $0.010 per GB |
| Data billed in AU | $0.060 per GB |
| Requests | $0.002 per 10,000 |
| Custom domain | $1 per domain per month, from the first one, billed by the hour while the domain and its zone are active and its CNAME (or ALIAS) points to the CDN |
The default hostname is included. Data is counted in GB of 109 bytes, headers included. Requests the CDN refuses itself, such as those of a paused zone, aren't billed.
Billing region. Each byte is billed at the cheaper of two regions: the one that served it, and your visitor's. A visitor in Oceania counts as AU, and a visitor anywhere else, or whose country is unknown, is billed at the cheapest region. So a byte served from Australia to a visitor in Europe costs the FR price, and a failover never raises your bill.
Prices can change. The console's CDN pages show the current ones, and the create form has a cost estimate. CDN lines appear in Compute Usage with the rest of your hourly usage.
Monthly spend cap
Each zone has a monthly spend cap: $20 by default, from $1 to $100,000. It is a hard stop, not a warning. The month runs in UTC. Its spend (traffic, requests and custom domains) is checked every minute, and shown in the zone list and on the zone's Settings tab.
- At 80% of the cap, you get an email.
- At the cap, the zone is paused, and you get an email. Every request, on the default hostname and on your custom domains, is answered
503, and nothing is billed: not the requests, not the custom domains. - No fallback. A paused zone doesn't send visitors to the bucket or redirect them anywhere: requests stop at the cache node. Your bucket and its files aren't touched.
- Resuming. Raise the cap on the zone's Settings tab: the zone serves again within a minute of the cap going above the month's spend. Otherwise it resumes by itself on the 1st of the next month. Either way, you get an email when it serves again.
Because the spend is checked every minute, a zone can end slightly above its cap.
If your account's unpaid usage gets its virtual machines stopped, its zones are suspended too: they answer 403 until the balance is settled, then serve again.
Emails
The account owner is emailed when a zone reaches 80% of its cap, is paused by its cap or serves again, is suspended for unpaid usage or blocked, when a custom domain turns active or needs action (DNS not proven after 1, 3 and 6 days: see Reminder emails; certificate not issued; DNS moved), when a certificate is about to expire or has expired, and on the 1st of each month with a summary of last month's CDN usage, if there was any. The monthly summary and the two DNS reminders respect the email notifications switch in your account settings; the others are always sent.
Where to next
- WAF: block, allow or rate-limit requests to a zone with firewall rules.
- Object Storage: create the bucket that serves as your origin.
- Billing and quotas: how hourly usage is charged.
- Shared accounts: give team members access to your CDN.