Working with services
Last updated 2023-05-26
A Fastly service is a user-defined set of caching rules and behaviors for a website or application. You might create new Fastly services to do things like:
- add a new website under your control to your list of web properties
- add a new domain to your growing list of existing domains already served by Fastly
- isolate traffic metrics for specific digital assets, like a site's images
Once created, you can edit and activate new versions of your Fastly services that include refinements and updates to your configurations. The web interface also allows you to do other things with existing Fastly services, like compare them to each other, deactivate or reactivate them, and delete them.
Before you begin
Before you begin working with Fastly services, be sure you understand how caching and CDNs work. You'll also need to understand the Fastly web interface controls before using them to work with your Fastly services.
TIP
This guide includes instructions for creating and interacting with both Deliver and Compute services. Our developer portal provides more information on working with services that take advantage of Compute@Edge.
Understanding Fastly services and versions
When you create a service, before it will do anything, you need to configure it. This configuration will tell Fastly how to handle traffic through your service. Officially, a configuration for a service is called a version of that service. You'll notice that your new service has a single, initial version (all new services start their existence this way). The initial version of a service is an inactive blank slate, waiting for you to configure and activate it. Once you activate your first version, your service will begin handling traffic according to your configurations.
Your service can have many versions. Each version has its own status:
- Draft is the status that every version starts with when it's first created. This status indicates that the version hasn't been activated and is still being edited. Only versions with draft status can be edited.
- Active is the status displayed by a version after you activate it. When you activate a version, you are telling Fastly to use that configuration for your service's traffic. Only one version of a service can be active at a time. Once a service becomes active, it also becomes locked, so it can no longer be edited, only deactivated or reactivated.
- Locked is the status displayed by a version after you deactivate it. This status primarily indicates that a version can't be edited. Active versions are also locked automatically when they first become active, but they display as active, not as locked.
Eventually, your service will probably have more versions displaying the locked status than any other. At some point, you may decide that one of these locked versions has a configuration you prefer to what is currently active. In that case, you can simply reactivate that version. Or, if some aspects of that version aren't viable anymore, you can clone it and make changes to the clone, which will have the draft status. Fastly maintains a complete record of the version history of your service to ensure that you can always roll a service back to any version.
Service creation limits
- Accounts are limited to a set number of services. We set a limit on the number of services you can create per account by default based on your account type and any packaged offering you've purchased. Reach out to sales@fastly.com for details on how to increase this limit.
- Each service is limited to a set number of domains. We set a limit on the number of domains you can create per service by default based on your account type and any packaged offering you've purchased. However, if you contact support, we may be able to adjust this number for you by working with you to set up and fine-tune domain handling in your service.
Creating a new service
You can create new Deliver and Compute services through the web interface.
Creating a new Deliver service
You can create new Deliver services through the web interface.
To create a new Deliver service, follow the steps below:
- Log in to the Fastly web interface.
From the Create service menu, select Deliver to create a new VCL-based service. A new, unnamed VCL service's configuration page appears.
Rename the service as necessary.
Optionally, add a comment to help you identify what you're working on.
Use the Domains fields to add a domain to the service.
Use the Hosts field to add a host to the service.
TIP
Many customers setting up services specify an override host at the same time. Check out our guidance on overriding a host at the origin level if you're interested in exploring this functionality.
Test your service configurations by opening
http://www.example.com.global.prod.fastly.net
in a new browser window, replacingwww.example.com
with your own website's domain name. Your website should appear, though it may take up to 60 seconds for new configuration settings to take effect.TIP
You can continue to explore various configuration settings for as long as you like before starting to serve traffic.
Click the Activate button at the top right of the screen. A confirmation window appears.
Click Confirm and Activate to confirm you want to activate your new service. The Deliver page appears with details about the configuration settings you've applied.
Once you’re ready, complete your service setup and start serving traffic through Fastly by setting your domain's CNAME DNS record to point to Fastly.
Creating a new Compute service
To create a new Compute service, follow the steps below:
NOTE
Some steps require using the Fastly CLI. If you haven't already, follow the steps for creating an API token, making sure it has global
scope. Then, download and install the Fastly CLI and use that token to authenticate your account before continuing.
- Log in to the Fastly web interface.
From the Create service menu, select Compute to create a new Wasm-based service. A new, unnamed Wasm service's configuration page appears.
Rename the service as necessary.
Optionally, add a comment to help you identify what you're working on.
TIP
After creating your Compute service, you can choose to complete the remaining configuration steps via the Fastly CLI.
Use the Domains field to add a domain to the service.
NOTE
Compute@Edge requires you to secure your domain using TLS.
Use the Hosts field to add a host to the service.
TIP
Many customers setting up services specify an override host at the same time. See our guidance on overriding a host at the origin level if you're interested in exploring this functionality.
Using the Fastly CLI, create a new Compute@Edge project. A local development environment and a
fastly.toml
package manifest will be generated.Open
fastly.toml
and add your service ID into theservice_id
property.Compile the project into a Wasm binary packaged for Fastly use. The package will be named
<name>.tar.gz
.Return to your service in the Fastly web interface.
Click the Package link. The Package page appears.
Click the Browse for Package button to navigate to the package file on your system.
Test your service configurations by opening
http://www.example.com.global.prod.fastly.net
in a new browser window, replacingwww.example.com
with your own website's domain name. Your website should appear, though it may take up to 60 seconds for new configuration settings to take effect.TIP
You can continue to explore various configuration settings for as long as you like before starting to serve traffic.
Click the Activate button at the top right of the screen. A confirmation window appears.
Click the Confirm and Activate button to confirm you want to activate your new service. The Compute page appears with details about the configuration settings you've applied.
Once you’re ready, complete your service setup and start serving traffic through Fastly by setting your domain's CNAME DNS record to point to Fastly.
Editing your services
You might want to edit a version of an existing service to do things like:
- change the amount of time information is retained in cache memory for a service
- configure a service to temporarily serve stale content should your origin server need to be unavailable for an extended period of time (for example, taken offline for maintenance)
- decrease the amount of time Fastly will wait for your origin server to respond to a request for content
Editing and activating versions of services
Fastly locks versions of services you've already activated to make rollbacks safer and provide version control. You can duplicate (clone) any existing service version, active or inactive, and edit that cloned version. You must activate new versions of services to deploy their configurations. Configuration changes are never automatically activated.
To make changes to a service and activate a new version, follow the steps below:
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
From the Edit configuration menu, select the appropriate service configuration action:
- Select Clone version [version number] (active) to clone the active version of the service for editing.
- Select Edit version [version number] (latest draft) to edit the latest draft of the service.
The service version page appears, listing the version.
Click the Activate button. The new version of the service is activated and appears in the event log.
Viewing all services
You can view all the services associated with your account or filter them to show only specific types of services.
Viewing a complete list of services
To view all your services, log in to the Fastly web interface. If you haven't yet created services, Fastly provides several options to help you with ideas for getting started. If you've already created at least one service, however, the Home page appears displaying a summary of all your services, sorted by requests per second, with services marked as your favorites listed first.
Clicking on each column in the displayed list will sort the entire list based on that content type. If you have a lot of services, you can view a condensed list by clicking the icon with three lines above the list of services.
TIP
If you have a lot of services, click the star icon ⭐ to the left of a service name to mark it as a favorite. You can view a subset of services using filters and include only your favorites.
Viewing a subset of all services
You can filter your list of services to show only services that match a specific service type (e.g., Deliver or Compute), that are active, and that you've designated as favorites. To filter your services, select the appropriate filters from the Filter menu above the list of services:
The filters you've applied to the list will appear as oval shapes above the list of services. You can remove a filter at any time by clicking the x
on any individual filter or by clicking the Clear filters link immediately above the list of services.
Switching between services and service versions
To switch between services associated with your account, follow these steps:
From the Service summary or Service configuration page, click the switcher icon to the right of the account name and ID.
Select the appropriate service from the list that appears.
To switch between versions of a specific service, follow these steps:
From the Service configuration page, click the switcher icon to the right of the version number.
Select the appropriate version from the list that appears.
Deleting a service
Fastly allows you to delete any service you create, along with all of its versions. Fastly does not offer a way to delete specific versions of a service, however. Service versions are meant to be an historic log of the changes that were made to a service. To undo changes introduced by a particular service version, you can always go back to a previous version and reactivate it or clone a new service version based on any old version.
To delete any service along with all of its versions, follow the steps below:
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- From the Options menu, select Deactivate. The deactivate service warning appears.
- Click the Confirm and deactivate button to confirm you want to deactivate your service and acknowledge that you no longer want to serve traffic with it.
- From the Options menu, select Delete. The confirm delete window appears.
- Click the Confirm and delete button to confirm that you want to delete the service.
IMPORTANT
To minimize the risk of unauthorized use of your domains, we strongly recommend modifying or deleting any DNS CNAME records pointing to the Fastly hostname associated with the deleted service. Follow the instructions on your DNS provider's website.
Other things you can do
In addition to creating or editing services, you can view all your services, rename them, compare versions of them, deactivate or reactivate specific versions of them, and delete them.
Renaming services
To rename your service, follow the steps below:
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- From the Options menu, select Edit service name. The Edit service name window appears.
- In the Service name field, enter a new service name.
- Click Apply. The newly renamed service name appears.
Adding comments to service versions
Service versions can include comments to label them (e.g., to identify reasons for changes in that version). You can add and update version comments on both locked and activated service versions.
- Log in to the Fastly web interface.
- From the Home page, 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 Add comment link in the upper right corner of the web interface.
The comment window appears.
In the Comment field, enter a meaningful comment for the version.
Click Save. The truncated version of the comment appears where the Add comment link used to be.
TIP
You can view service version comments at any time by clicking the service version number to display the version selection menu or by clicking the version comment icon to display the version comment in a separate window. Version comments also appear in the event log to help with account activity monitoring.
Comparing different service versions
To compare two versions of a service, follow the steps below:
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
Click the Diff versions link. The Diff versions page appears.
Removals are highlighted in red and the additions and changes are highlighted in green. Any large blocks of unaffected configuration lines can be expanded and viewed or collapsed and hidden by clicking on the plus (+) sign to the left of the actual changes, next to the line numbers.
TIP
You can change the compared service versions by clicking Switch versions and selecting a different version number in the menu that appears.
Deactivating a service
To deactivate a service, follow the steps below:
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- From the Options menu, select Deactivate. The Deactivate service window appears.
- In the Enter service name field, enter the exact service name to deactivate.
- Click the Confirm and deactivate button to confirm you want to deactivate your service and acknowledge that you no longer want to serve traffic with it.
IMPORTANT
To minimize the risk of unauthorized use of your domains, we strongly recommend modifying or deleting any DNS CNAME records pointing to the Fastly hostname associated with the deactivated service. Follow the instructions on your DNS provider's website.
You can also activate or deactivate a service via the API. Did you accidentally delete a service? We can help.
Reactivating a service
To reactivate a service, follow the steps below:
- Log in to the Fastly web interface.
- From the Home page, 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 Activate. The service is reactivated.
- If you removed the DNS CNAME records for the service's domains when you deactivated the service, you should add new DNS CNAME records now.
Getting help with accidental service deletions
Services can be deactivated or deleted. Deactivated services can be reactivated at any time, but once they've been deleted you must contact Customer Support to have them restored. When sending your request, remember to include:
- your customer ID
- your company name
- your service ID (the name of the service you want restored)
Customer Support will notify you when your service has been restored.
What's next
Learn more about working with domains, hosts, and health checks as you continue to refine versions of your service configurations.
Do not use this form to send sensitive information. If you need assistance, contact support.