Documentation

Developer docs

Everything you need to put LazerFast in front of your site, from your first zone to automating purges in CI.

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.

  1. Sign in to the LazerFast Console and choose Zones → Create zone.
  2. Enter the hostname you want to serve and your origin URL, such as https://origin.example.com.
  3. Create the DNS record shown in the console (see below).
  4. 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.
For an apex domain (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

HeaderDescription
x-lazer-cacheHIT, MISS, STALE, BYPASS or EXPIRED
x-lazer-popThe IATA code of the PoP that served the request, such as fra
x-lazer-request-idA unique request ID. Include it in support tickets.
ageSeconds 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

MethodPathDescription
GET/v1/zonesList zones
POST/v1/zonesCreate a zone
GET/v1/zones/:idGet zone details and status
PATCH/v1/zones/:id/settingsUpdate zone settings
POST/v1/zones/:id/purgePurge cached content
GET/v1/zones/:id/analyticsTraffic and cache analytics
GET/v1/ipsPublished 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.

Need help? Contact support and include the x-lazer-request-id of an affected request.