Hazeloft CDN: setup, caching and Edge Rules
How to turn on the CDN for a domain connected in Hazeloft and what you control from the platform afterwards, from Caching and purging to Edge Rules and logs.
Last updated:
Hazeloft CDN keeps your site’s responses in a cache at the edge. You turn it on and manage it from the platform, per domain, with no API key and no code changes.
Requirements
- A plan that includes CDN. The minimum plan is on the product page.
- The domain is connected in Domains and delegated to the Hazeloft nameservers. The CDN does not work with DNS kept at another provider.
- The domain root has an A, AAAA or CNAME record pointing to the server your site runs on. The CDN sits in front of it, and that server remains the origin.
Turning it on
- Open the domain’s CDN page in the platform. If the domain is not delegated, the page tells you to point the domain to Hazeloft and sends you to Domains.
- Press “Enable CDN”. Without a website record at the root, activation stops and asks you to add one.
- The status goes from “Enabling…” to “Enabled”, and the domain appears in the CDN list with its request count and cache rate.
Only the record at the root is accelerated. Subdomains, including www, are not enabled separately.
A domain’s sections
Every domain with the CDN on has the same sections:
| Section | What it controls |
|---|---|
| Caching | What stays in the cache and for how long, plus purging. |
| Edge Rules | Rules applied to requests whose URL matches a pattern. |
| Optimizer | WebP and AVIF conversion, image resizing and CSS and JavaScript minification. |
| Logs | Requests, cache rate, traffic and errors, over 6 hours, 24 hours or 3 days. |
| Settings | The zone’s state, read-only, and turning acceleration off. |
Caching
Five switches and one value. You change them and press “Save”.
| Setting | What it does |
|---|---|
| Smart cache | Caches responses automatically. |
| Serve stale while updating | The visitor gets the cached copy while the edge fetches a fresh one from the origin. |
| Cache error responses | Briefly keeps the origin’s errors. |
| Sort query strings | Brings URL parameters into the same order, so the same page does not take several cache entries. |
| Origin Shield | Adds an intermediate cache layer between the edge and your server. |
| Override Cache-Control | Max-age in seconds, enforced over what the origin sends. -1 respects the origin; 0 turns the cache off. |
Purging the cache
- By URL: you enter the full address of the file, and the platform checks that it is on your domain.
- All content: purges the domain’s entire cache, after a confirmation.
The next requests fetch fresh copies from the origin.
Edge Rules
A rule has a single URL pattern (for example https://example.com/blog/*) and one of four actions:
| Action | What it does |
|---|---|
| Redirect | Sends the visitor to another URL. |
| Set response header | Puts a header, with a name and value you choose, in the response to the visitor. |
| Override cache time | Sets, in seconds, how long matching responses stay in the cache. |
| Block request | Refuses matching requests. |
Matching is on the URL only: you cannot set conditions on country, headers or method. A rule can be turned off, turned back on or deleted without touching the others.
Metrics and logs
Metrics cover the last seven days, in three cards: Edge Requests, CDN Caching and Bandwidth. You see requests, the cache rate (Hit Rate), the requests that reached the origin (Origin Pulls) and 5xx errors.
Edge logs have an hourly series and rankings by path, status code, country and network. They cover at most the last 72 hours; there is no export and no forwarding to an external log service.
Optimizer
Optimizer does WebP and AVIF conversion for the browsers that support them, automatic image resizing and CSS and JavaScript minification, at the edge. It starts from a plan above the minimum one for CDN; see the product page.
Turning it off
“Disable CDN acceleration”, in Settings, deletes the domain’s CDN zone, together with its Caching settings and rules. The domain stays in Domains, and the root record points straight to your server again. When you turn it back on, you start with a new zone.
The same happens automatically, for all the account’s domains, if the subscription drops below the minimum plan.
Limits
- Only domains on the Hazeloft nameservers; there is no option to add a CNAME at your current DNS.
- Only the domain root, with a single CDN zone per domain.
- There is no region selector and there are no per-region statistics.
- Firewall rules are not part of the CDN: they live in Hazeloft Security.