Set up your API configuration for testing

Before you go live and start serving traffic through the production network, we recommend that you activate your property on the edge staging network and point your browser to an edge server. You can use this network of edge servers to send test requests and make sure that your connection with Akamai has been established properly.

Activate API Gateway in the staging environment

You can activate a new version of your property with the API Gateway behavior in the staging environment to verify and test your configuration before going live with it.

  1. In Control Center go to > CDN > Properties.

  2. On the Property Groups page, select the Property Name link for your property.

  3. On the Property Details page, click the version of your configuration with the Akamai API Gateway behavior enabled.

  4. On the Property Manager Editor page, on the Activate tab, click Activate v# on Staging.

  5. Track progress by monitoring the Activate tab.
    The activation process takes approximately 10 minutes.

Point your computer to the edge servers

To test your property configuration on staging, first modify your hosts file to direct your computer to request content from a staging edge server rather than your origin server. This practice is commonly referred to as spoofing.

  1. In Control Center go to > CDN > Properties.

  2. On the Property Groups page, select the Property Name link for your property.

  3. On the Property Details page, click the version that you want to test.

  4. On Property Manager Editor page, in the Property Hostnames section, find your edge hostname.

  5. Look up the IP address of the staging version of that edge hostname using one of the methods below, and copy it to your local clipboard.
    The staging version of your edge hostname inserts -staging before the final .net.

    • On a Windows computer, open a new command prompt and perform an nslookup of the staging hostname: nslookup my-api.hostname.edgekey-staging.net
    • On a Mac computer or Linux/Unix machine, open a new terminal, and perform a dig of the staging hostname: dig my-api.hostname.com.edgekey-staging.net
  6. Open your local hosts file in a text editor.
    Depending on your operating system, use one of the following methods to locate your host file:

    • On Windows computer, go to C:\Windows\System32\drivers\etc\hosts. The directory above \system32\ might vary in your environment.
    • On Mac computer, go to /private/etc/hosts.
    • On Linux/Unix machine, go to /etc/hosts.
  7. At the end of the hosts file, add an entry for your origin hostname that includes the IP address of the staging version of the edge hostname (from clipboard) and also your property’s domain. For example: 1.2.3.4 my-api.hostname.com

  8. Save and close the hosts file.

    📘

    To undo the redirection to the edge server, remove the new entry from your hosts file.

  9. On Mac OS X 10.6 and later, run the following command to flush your DNS cache: dscacheutil -flushcache