Quick start
This guide takes you from a new account to content served through CDNify. Each step can be done in the customer portal or with the API v2.
1. Create an account
Sign up in the customer portal with your e-mail address and a password. We send you a verification e-mail: open its link to verify the address. Some actions, such as creating API tokens, need a verified address.
Protect the account with a second factor: add an authenticator app (TOTP) from your account settings and keep the recovery codes in a safe place.
2. Add a site
A site connects a CDN hostname to your origin, the server that holds your content. In the portal, open Sites and create a site: enter the origin hostname and the protocol used to reach it, choose a name of 5 to 63 lowercase letters and digits, which becomes part of the CDN hostname, and review the delivery settings.
The site is created at once and deployed to every edge location in the background. Its status moves from validating through provisioning and deploying to active.
Origins on private, loopback or link-local addresses are refused, so the CDN never fetches content from an internal network.
curl -X POST 'https://api.cdnify.lat/api/v2/sites' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"alias":"example01","origin":{"scheme":"https","host":"origin.example.com"}}'3. Point your DNS
You can use the CDN hostname directly in the URLs of your assets. To serve content from your own hostname, such as cdn.example.com, add it as a custom domain of the site and create a CNAME record at your DNS provider that points to the CDN hostname shown for the site.
cdn.example.com. 3600 IN CNAME example01.a.cdnify.io.DNS changes can take up to 24 hours to propagate, depending on the TTL of your records.
The root of a domain (example.com) cannot hold a CNAME record with most DNS providers. Use a subdomain such as cdn.example.com.
curl -X POST 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"hostname":"cdn.example.com"}'4. Verify the domain
When you add a custom domain, CDNify returns the DNS records that prove you control it: a TXT or CNAME record, as shown with the domain. Create them at your DNS provider, then check the domain from the portal or with the verification operation.
The domain becomes active once the records are found. An unverified claim expires after a while; if it expires, or another account verifies the hostname first, add the domain again to get new records.
curl -X POST 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/custom-domains/domain_example/verification' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"5. Secure the domain with a certificate
A custom domain needs a certificate to be served over HTTPS. You can choose a managed certificate, which CDNify requests through ACME and renews automatically, or upload a certificate of your own.
Managed certificates are available for verified custom domains. HTTP validation works when the domain already points to CDNify; otherwise use DNS validation.
6. Purge content when it changes
CDNify keeps copies of your files at the edge. When a file changes at the origin before its cache lifetime ends, purge it: either a list of paths or everything.
Purges run asynchronously: the request is accepted at once and you can follow its progress on each edge location in the purge history.
curl -X POST 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/purge-requests' \
-H "Authorization: Bearer $CDNIFY_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"kind":"url","paths":["/css/site.css","/images/logo.png"]}'