Edge Network
Every public request to your app goes through the StackBlaze edge network first. The edge handles HTTPS, caches static files, filters abusive traffic and forwards everything else to the region where your app runs. There is nothing to set up.
Locations
The edge runs in five locations. Each location has at least two edge servers with different hosting providers, so one server or one provider failing does not take a location down.
| Location | City |
|---|---|
| US West | California |
| US East | New Jersey |
| Europe | Amsterdam |
| Asia | Singapore |
| Australia | Sydney |
Visitors are sent to the nearest location by DNS. Edge servers are health-checked continuously, and a server that stops answering is taken out of DNS automatically. You never point anything at an edge IP address: every hostname StackBlaze gives you is a DNS name, so edge servers can be added or replaced without any change on your side.
The edge location and the region your app runs in are separate. A visitor in Europe reaches the Amsterdam edge, and the edge forwards the request to your app’s region.
What goes through the edge
| Traffic | Hostnames |
|---|---|
| Your apps over HTTP and HTTPS | *.stackblaze.app |
| Custom domains | Every domain you attach to an app |
| StackBlaze API | api.stackblaze.cloud |
| StackBlaze CLI | Every command, through api.stackblaze.cloud |
| Data backup and restore | Backup uploads, downloads and restores |
| Public database access | Postgres, MySQL / MariaDB, Redis and MongoDB, when you turn it on |
Private networking between your own services does not go through the edge. See Private networking.
HTTPS
The edge terminates TLS. It accepts TLS 1.2 and 1.3 and serves HTTP/2. Plain HTTP requests get a 308 redirect to the same URL over HTTPS.
Certificates are issued and renewed automatically, for *.stackblaze.app and for your custom domains once their DNS is verified. See SSL / TLS and Custom domains.
Caching
The edge caches static files only. HTML pages, API responses and anything else always go to your app.
These file types are cached:
js mjs css map wasm
png jpg jpeg gif svg webp avif ico
mp4 webm
woff woff2 ttf eot otfOnly successful GET responses (200) of up to 1 MB are cached, so large videos and images always come from your app. The cache key is the hostname, the path and the query string.
A cached file is kept for up to 30 days. Each edge server has its own cache in memory: files that are rarely requested are dropped first when it fills up, and the cache starts empty again after an edge server restarts.
A response is never stored, even for a static file, when:
- your app sends
Cache-Control: private,no-storeorno-cache - your app sends
Vary: CookieorVary: * - your app sets a cookie (
Set-Cookie) - the request has an
Authorizationheader (it is also never answered from the cache)
Changing a static file
app.3f9c2b.js), which Vite, Next.js, webpack and most other build tools do by default. A new build then produces new file names, and visitors get the new files straight away.Every response carries an x-ex-status header that tells you what the cache did:
| Value | Meaning |
|---|---|
HIT | Served from the edge cache. The request did not reach your app. |
MISS | Cacheable, but not in the cache yet. Your app answered and the edge stored the response. |
BYPASS | Not cacheable. Your app answered and nothing was stored. |
curl -sI https://my-service.cloud-east-1.stackblaze.app/assets/app.3f9c2b.js | grep -i x-ex-statusVisitor IP address
The edge adds the visitor’s address to X-Forwarded-For and sends it as X-Real-IP. StackBlaze trusts these headers only when they come from an edge server, so the client IP your app or framework reports is the visitor’s real address.
The edge also sends X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Port with the scheme, hostname and port the visitor used.
Protection against floods
Each client address can send up to 100 requests per second to a site, averaged over 10 seconds. Requests above that get 429 Too Many Requests. An address that keeps going, with 1,000 requests over the limit, is blocked by that edge server for up to 10 minutes.
When one hostname gets more than 500 requests per second on an edge server, or the server is under heavy load, visitors who load a page on that hostname get a short browser check: one “I’m human” checkbox. Visitors who pass continue as normal. API calls, webhooks and files such as images are never shown the check; while it is on, they get a lower per-address limit instead. Each hostname is checked on its own, so a flood on one app does not affect other apps. Search engine crawlers from Google and Bing never get the check. It ends by itself 15 minutes after the hostname was last over the limit.
Database connections
When you turn on public access for a Postgres, MySQL / MariaDB, Redis or MongoDB database, connections from outside StackBlaze go through the edge. The dashboard shows the address and connection string on the database’s Public access card.
- Connections use TLS.
- Only the IP addresses or ranges you list can connect (up to 50). Allow any IP is available, but then anyone who has the password can connect.
- A database without a password cannot be made public.
SSH
Coming soonSSH into a running app through the edge, with your own SSH key.