Test your configuration

Before you start serving traffic through the ​Akamai​ production network, it's a good idea to activate all applicable components on the edge staging network, point your browser to an edge server, and test.

📘

Staging is a network of edge servers that are used for testing configurations rather than performance.

HTTPS custom certs only: Push the edge certificate to staging

If you're going to use a custom certificate for the end user to edge server connection, you need to push it to the staging network before you test your HTTPS delivery.

By default, when you create a CPS-managed certificate, it is automatically deployed to the production network. To test the cert, you need to manually push it to the staging network. This is done in Certificate Provisioning System.

Look up the edge server IP address on staging

To test a configuration, first you need to obtain the IP address of the edge server used on the Akamai Staging network.

  1. On the Property Details page, in the Manage Versions and Activations section, select the version of your property you want to test.

  2. On the Property Manager Editor page, find your edge hostname in the Property Hostnames panel.

  3. Look up the IP address of the staging version of that edge hostname and copy it to your clipboard. The staging version of your edge hostname inserts -stagingbefore the final .net.

    • Windows: Open a new command prompt and perform an nslookupof the staging hostname:
    nslookup www.example.com.edgekey-staging.net
    
    • Mac OS, Linux or Unix: Open a new terminal, and perform a digof the staging hostname:
    dig www.example.com.edgekey-staging.net
    

    The IP address of the staging edge hostname appears in the response.

  4. If you're using Global Traffic Manager (GTM) or China CDN:

    1. In the lookup response, make note of the CNAME hostname, for example, e1111.x.akamaiedge.net. For nslookup, this value is in the Name field.

    2. Perform the look-up again, adding -staging before the final .net.

    3. Copy the IP address of the staging edge hostname to a clipboard.

Point your browser to the edge servers

You need to modify your hosts file to point your system to request content from ​Akamai​ staging edge servers, rather than your origin server. This practice is commonly referred to as spoofing.

  1. Open your local hosts file in a text editor. You can typically find the hosts file as follows, based on your OS:

    • Windows: Navigate to C:\Windows\System32\drivers\etc\hosts. The directory above \system32\ might vary in your environment.

    • macOS: Navigate to /private/etc/hosts.

    • On Linux/Unix: Navigate to /etc/hosts.

  2. At the end of the hosts file, add an entry for your website that includes the staging IP address and your property's domain. For example: 1.2.3.4 www.example.com

  3. Save and close the hosts file.

    📘

    This only applies to your local system. Also, to undo the redirection to the edge server, remove the new entry from your hosts file.

  4. On Mac OS X 10.6 and later, run the following command to flush your DNS cache. (This doesn't apply to Windows or Linux/Unix.)

    dscacheutil -flushcache
    
  5. Confirm that your computer points to an edge server.

    If you're using HD streaming and the hosts file is blocked by the internal network or admin:

  6. Use a command-line tool such as curl to specify the Host header on the HTTP request. For example:

    curl -i -H "host: test-i.akamaihd.net" -d "test" "http://post.test-i.akamaihd-staging.net/xxx/test/index.m3u8""
    HTTP/1.1 200 OK
    .
    .
    .
    X-Akamai-Staging: EdgeSuite
    

    The presence of the X-Akamai-Stagingresponse header confirms that your test request hit the Staging network.

Confirm that your computer points to an edge server

Verify that you've properly pointed your system to our edge servers to begin testing.

Making a request to ​Akamai​ staging edge servers adds the HTTP response header X-Akamai-Staging. The value sent with this header is either ESSL for HTTPS requests or EdgeSuite for HTTP requests to the staging network.

After your browser points to the staging edge servers, make a test request against the new property configuration on the staging network, and then check for the X-Akamai-Stagingresponse header to see if the response is coming from the staging network.

  1. Close all browser windows and reopen your browser.

  2. Go to a page you want to test, for instance, www.example.com.

  3. Access Network and make a request to the page.

    • Chrome: Press Ctrl+Shift+I (Windows) or Command+Opt+I (Mac) for the developer tools, and click the Network tab.

    • Firefox: Press Ctrl+Shift+I (Windows) or Command+Opt+E (Mac). This takes you to the Network tool.

    • Internet Explorer/Microsoft Edge: Press F12, and then press Ctrl+4 to open the Network utility.

  4. Click the first file listed.

  5. Take a look at the response headers. If you see either X-Akamai-Staging: ESSLor X-Akamai-Staging: EdgeSuiteyou know that your request is going to the staging edge server.

  6. Check for the X-Cache entry.

  7. Use this list to interpret the results.

Did the page load as expected?Is the X-Cache entry present?Result
YesYesSuccess! You're ready to test.
NoYesYou reached an edge server, but something isn't working. The value of the X-Cache entry might help you identify the problem.
YesNoYou reached the origin, not the edge server. Check the entry you added to your hosts file.
NoNoYou have not reached either the edge or your origin. Check the entry you added to your hosts file.

Test the configuration on staging

Test your site just as you would if you were testing on the origin server.

📘

When developing tests, don't use edge hostnames to request content. Use edge hostnames only to resolve your content to the edge network.

  1. Check your site's key functionality, such as logging in, using the shopping cart, and so on.

  2. Once you're satisfied that your site works, remove the new entry from your hosts file and save it.

  3. On Mac 10.6 and later, flush your DNS cache again with the dscacheutil -flushcachecommand.

    If the testing is successful, you can push the property and, if applicable, the associated custom edge certificate, to the ​Akamai​ production network.

To learn more about configuration testing, refer to the Test Center documentation.