Quickstart
A zone is a hostname served by LazerFast, such as cdn.example.com. Each zone has an origin, the server LazerFast pulls content from on a cache miss.
- Sign in to the LazerFast Console and choose Zones → Create zone.
- Enter the hostname you want to serve and your origin URL, such as
https://origin.example.com. - Create the DNS record shown in the console (see below).
- Wait for the zone status to change to Active. This usually takes under two minutes.
Point your DNS
Create a CNAME record for your hostname that points to your zone’s edge hostname:
cdn.example.com. 300 IN CNAME z-4f8a2c.edge.lazerfast.net.
example.com), use your DNS provider’s ALIAS/ANAME/CNAME-flattening feature, or point A/AAAA records at the anycast addresses listed in the console.TLS certificates
Once DNS resolves to LazerFast, we issue a certificate for your hostname automatically and renew it 30 days before it expires. Enterprise plans can upload custom certificates under Zone → TLS.
How caching works
By default LazerFast follows your origin’s Cache-Control and Expires headers. Responses with private, no-store or a Set-Cookie header are not cached. If the origin sends no caching headers, static file extensions are cached for 4 hours and everything else bypasses the cache.
The cache key is the scheme, host, path and full query string. Use Page Rules to ignore or sort query parameters, or to vary the key on a header.
Purging content
Purges reach every PoP, usually within 150 ms. You can purge by exact URL, path prefix, cache tag (sent by your origin in the Cache-Tag header) or the whole zone.
curl -X POST https://api.lazerfast.net/v1/zones/$ZONE_ID/purge \ -H "Authorization: Bearer $LZF_TOKEN" \ -H "Content-Type: application/json" \ -d '{"tags": ["product-1842", "homepage"]}'
Response headers
| Header | Description |
|---|---|
x-lazer-cache | HIT, MISS, STALE, BYPASS or EXPIRED |
x-lazer-pop | The IATA code of the PoP that served the request, such as fra |
x-lazer-request-id | A unique request ID. Include it in support tickets. |
age | Seconds since the object was fetched from the origin |
Image Optimizer
Add transform parameters to any image URL on a zone with Image Optimizer enabled:
https://cdn.example.com/products/shoe.jpg?width=640&height=640&fit=cover&format=auto
With format=auto, the best format is picked from the request’s Accept header. Transformed variants are cached like any other object, and a purge of the source URL also purges every variant.
API authentication
The REST API is served from https://api.lazerfast.net/v1. Create an API token in the console under Account → API tokens and send it as a bearer token:
curl https://api.lazerfast.net/v1/zones \
-H "Authorization: Bearer $LZF_TOKEN"
Tokens can be scoped to specific zones and permissions (zone:read, zone:edit, purge, analytics:read). Treat tokens like passwords and rotate them regularly.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/zones | List zones |
POST | /v1/zones | Create a zone |
GET | /v1/zones/:id | Get zone details and status |
PATCH | /v1/zones/:id/settings | Update zone settings |
POST | /v1/zones/:id/purge | Purge cached content |
GET | /v1/zones/:id/analytics | Traffic and cache analytics |
GET | /v1/ips | Published edge and egress IP ranges |
Rate limits
API requests are limited to 1,200 per five minutes per token. Purge requests are limited to 1,000 URLs or 100 tags per call. Responses include x-ratelimit-remaining and x-ratelimit-reset headers, and requests over the limit receive 429 Too Many Requests.
x-lazer-request-id of an affected request.