Working with services

A service is a user-defined set of caching rules and behavior for a website or application. You might create new 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 services that include refinements and updates to your configuration settings. The web interface also allows you to do other things with existing services, like compare them to each other, deactivate or reactivate them, and delete them.

Before you begin

Before you begin working with 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 services.

Creating a new service

To create a new service, follow the steps below:

  1. Log in to the Fastly web interface.
  2. Click the Create service button. The Create service menu appears with the types of services you can create.
  3. Select VCL to create new VCL-based service. A new, unnamed VCL service's configuration page appears.
  4. Rename the service as necessary.
  5. Optionally, add a comment to help you identify what you're working on.
  6. Use the Domains fields to add a domain to the service.

    Create a domain

  7. Use the Hosts field to add a host to the service.

    Create a host

  8. Test your service configurations by opening http://www.example.com.global.prod.fastly.net in a new browser window, replacing www.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.

  9. Click the Activate button at the top right of the screen. A confirmation window appears.
  10. Click Confirm and Activate to confirm you want to activate your new service. The Configure page appears with details about the configuration settings you've applied.
  11. 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:

  1. Log in to the Fastly web interface and click the Configure link. The Configure page appears.
  2. Click the Edit Configuration button. The Edit Configuration menu appears.

    The Configuration button

  3. 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.

  4. Click Activate. The new version of the service is activated and appears in the event log.

Viewing all 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 All services page appears displaying a summary of all your services, sorted by requests per second, with starred services listed first.

the All services page

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.

the condensed list of services

Switching between services and service versions

To switch between services associated with your account, click the switcher icon to the right of the account name and ID and select the appropriate service from the list that appears.

The service switcher

To switch between versions of a specific service, click the switcher icon to the right of the version number and select the appropriate version from the list that appears.

The service version switcher

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:

  1. Log in to the Fastly web interface.
  2. From the All services page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. Click the Options link and select Deactivate. The deactivate service warning appears.
  4. 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.
  5. Click the Options link again and select Delete.

    delete a service

    The confirm delete window appears.

    the Confirm Delete window

  6. Click the Confirm and delete button to confirm that you want to delete the service.

Other things you can do

In addition to creating or editing services, you can view all your services, star them to pin them to the top of the All services page, rename them, compare versions of them, deactivate or reactivate specific versions of them, and delete them.

Starring services

If you have a lot of services, you can star the services you use most often to mark them as important and pin them to the top of the All services page. Click the star next to a service to pin it to the top of the page.

the list of services with one pinned

Renaming services

To rename your service, follow the steps below:

  1. Log in to the Fastly web interface.
  2. From the All services page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. Select the service name text box and enter a new service name.

    renaming a service

  4. Press enter. 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.

  1. Log in to the Fastly web interface.
  2. From the All services page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.
  4. Click the Add comment link in the upper right corner of the web interface.

    the add comment link

    The comment window appears.

    the version comment window

  5. In the Comment field, enter a meaningful comment for the version.
  6. Click Save. The truncated version of the comment appears where the Add comment link used to be.

    the service version

Comparing different service versions

To compare two versions of a service, follow the steps below:

  1. Log in to the Fastly web interface.
  2. From the All services page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. 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.

    an example comparison of two service versions

Deactivating a service

To deactivate a service, follow the steps below:

  1. Log in to the Fastly web interface.
  2. From the All services page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. Click the Options link and select Deactivate.

    deactivate a service

    The Deactivate service window appears.

    the Deactivate Service warning

  4. In the Enter service name field, enter the exact service name to deactivate.
  5. 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.

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:

  1. Log in to the Fastly web interface.
  2. From the All services page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.
  4. Click Activate. The service is reactivated.
  5. 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:

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.

Back to Top