Core concepts
Regardless of whether you are using Compute@Edge or VCL, your Fastly services need domains (to receive traffic), backends (to forward traffic onwards), TLS (to secure connections between Fastly and end users), and DNS (to point your domains to Fastly).
Setting up a backend
Backends are servers you can make requests to from Fastly, usually your own servers. For a full guide see integrating with backend technologies, but for a simple use case, follow these steps:
- Web interface
- CLI
- API
- Log in to the Fastly web interface and select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.
- Click the Origins link. The Origins page appears.
- If you don't see the Hosts field, click the Create a host button. The Hosts field appears.
- In the Hosts field, enter the hostname or IP address of your origin server.
- Click the Add button to add your host.
- Optionally click the pencil icon next to the Host to edit the following backend settings:
- In the Name field, enter a derivative of the hostname (
example_com
) or the purpose of the backend (primary_content
), using only lowercase alphanumerics and underscores. - In the Override host field, enter the same hostname as the backend's hostname.
- In the Name field, enter a derivative of the hostname (
Setting up a domain
Domains point traffic to your Fastly services. To allow clients to connect to Fastly using your domain, Fastly must be able to establish a secure connection on your behalf. We have many TLS service options available (for full details consult routing traffic to Fastly), but if you are happy to use a default TLS configuration and have Fastly issue certificates on your behalf, create a TLS subscription for your domain.
To do this, clone the active version of your service, add the domain, and activate the new version. Next, add a TLS subscription for that domain to your account. Finally, configure your DNS provider or domain registrar to verify your domain ownership.
- Web interface
- CLI
- Log in to the Fastly web interface and select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.
- If you already have domains, click the Create domain button.
- Enter a hostname or IP address.
- Click the Add button. Your new domain appears in the list of domains.
- Click the Activate button to save and activate the new version of your service.
- Click the Secure link in the top navigation bar. The Secure page appears.
- Click the Manage certificates button. The TLS domains page appears displaying any domains for which TLS has been or can be activated.
- Click the Get started button if it is available. Otherwise, click the Secure another domain button and select Use certificates Fastly obtains for you.
- In the Domain field, enter the domain name and click the Add button. If your account has access to multiple certification authorities or TLS configurations, there's more to it.
- Click the Submit button.
- Note the CNAME record required for verification.
You now have the ACME challenge CNAME
record required to prove that you own the domain. Log in to your DNS provider or domain registrar and configure the required record. For example:
- Record type:
CNAME
- Subdomain:
_acme-challenge
- Target host:
lxpqwv66ixn7e3bn4r.fastly-validations.com
Fastly will periodically check for these records to be published. When verification is complete, the status of the subscription will change from "Pending verification" to "Activated".
Once the domain is activated, you can retrieve the DNS records that point traffic on your domain to Fastly:
- Web interface
- CLI
- Log in to the Fastly web interface.
- Click the Secure link in the top navigation bar. The Secure page appears.
- Click the Manage certificates button.
- Find the domain you want and click the View details button.
- Note the CNAME, A, and AAAA records.
Back in your DNS provider or domain registrar, add the DNS records to point your domain to Fastly.
- If the domain is a subdomain, such as
www.example.com
ormy-website.herokuapp.com
, use the CNAME records. - If the domain is an apex, such as
example.com
orexample.co.uk
, use the A and AAAA records.
HINT: Use subdomains if possible. We can do more resilient, faster routing if you use a CNAME with a subdomain instead of using an apex domain. Find out more about routing traffic to Fastly.
Once these records are configured, you should be able to visit your Fastly-hosted website by entering your new domain into the browser (you may need to wait some time for the DNS records to propagate across the Internet).
Advanced concepts
Read more about all Fastly's features and technical principles:
- Cache freshness
- Compression
- Data stores
- Dynamic configuration
- Errors
- Geolocation
- Health checks
- Linked resources
- Load balancing
- Points of presence
- Purging
- Rate limiting
- Real time push messaging
- Redundancy and failover
- Request collapsing
- Routing traffic to Fastly
- Service chaining
- Shielding
- Staleness and revalidation
Content served through Fastly is cached based on freshness rules you define in Cache-Control
headers or in the configuration of your Fastly service. Within each Point of Presence (POP), many servers act together in a cluster to provide a single large, efficient pool of cache storage.
Fastly POPs operate independently of each other and forward requests to your origin server if a request cannot be satisfied in that POP. Similar requests arriving at the same time in the same POP are collapsed and only one is forwarded. However, using shielding you can opt to focus all origin requests from across the Fastly network to a single Fastly POP, greatly reducing origin traffic, especially if your customers are spread globally.
Our purging system allows objects previously cached by Fastly to be marked stale or invalidated entirely. Globally purging an object takes around 150ms.