Akamai Headers

Install two plug-ins

https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh

Header Editor

And then insert the following key:

x-pragma-allow: RGV2dSRlcjE6QGthbWFpcGEkJHcwcmQ

Or you can import this:

HE_2022-11-01T17-52-40Z.zip

Akamai Debug Headers

https://chrome.google.com/webstore/detail/akamai-debug-headers/lcfphdldglgaodelggpckakfficpeefj?hl=en

You need both the above plug-in and also the Akamai Debug Headers plug-in running, in order for things to work.

The above loads a token.

Akamai Book2 Required Fix

From: Girish Keshav <gkeshav@akamai.com>
Date: Wednesday, March 21, 2018 at 1:23 AM
To: "Van, Johnna (HA Group)" <JVan@HollandAmericaGroup.com>
Subject: Re: eCommerce issue

Book2.hollandamerica.com  origin does not likes/honors requests from www.hollandamerica.com but likes from book2.hollandamerica.com and beta.hollandamerica.com

So all I did was to forward the request to book2.hollandameirca.com and modify the host from www.hollandamerica.com to book2.holland America.com

So in short

Instead of receiving https://www.hollandamerica.com/cruise-ecommerce/brand/HAL/v1/cruise/O873/price/payment

It receives

https://book2.hollandamerica.com/cruise-ecommerce/brand/HAL/v1/cruise/O873/price/payment

Akamai Whitelist IP Address

Refer: https://youtu.be/tkBuT7d_TF4

Sample White Listed IPs

Steps to Reach IP Lists:

  1. Configure, Network List Management
  2. "Search Network Lists" with "holland"

Currently as of 01/22/2018 3 Lists :

  • Holland IP Bypass List - Contains VPN for example, these IPs will bypass the WAF
  • Reputation Whitelist (Holland) - Currently Empty, will white list IPs that have a bad reputation
  • Holland Partner IP List (Bot Manager) - Majority of IPs here, and these will automatically put this into “monitor mode” and NOT block them

How to get IP address to point to Akamai Staging

Quick Utlity Using Docker

Refer: https://github.com/markSmurphy/akamai-staging

docker run --rm -it \
  node:18-alpine \
  sh -lc "\
    npm install -g akamai-staging && \
    staging www.hollandamerica.com \
  "

Online Tool

https://www.digwebinterface.com/?hostnames=api.barclays.hollandamerica.com.edgekey-staging.net%0D%0Adev-api.barclays.hollandamerica.com.edgekey-staging.net.&type=&ns=resolver&useresolver=9.9.9.10&nameservers=

Overview of Steps

Step 1: dig book.hollandamerica.com | grep -i edgekey
Step 2: take the edgekey value and append -staging to it and dig it again
Step 3: dig www.hollandamerica.com.edgekey-staging.net
Step 4: Use the answer section and grab the IP address, use in your hosts file
Step 5: Turn on modify headers with Akamai Pragma and look for X-Akamai-Staging

Doing the work

$ dig book.hollandamerica.com | grep -i edgekey
book.hollandamerica.com. 29706 IN CNAME book.hollandamerica.com.edgekey.net.
book.hollandamerica.com.edgekey.net. 6 IN CNAME e4069.x.akamaiedge.net.

$ dig book.hollandamerica.com.edgekey-staging.net
;; ANSWER SECTION:
book.hollandamerica.com.edgekey-staging.net. 300 IN CNAME e4069.x.akamaiedge-staging.net.
e4069.x.akamaiedge-staging.net. 20 IN A 23.34.148.111

This works as of 2017-09-22
/etc/hosts
72.246.55.134 book.hollandamerica.com

You shoud now see this in the header response:
X-Akamai-Staging ESSL

Using Fiddler to set Akamai Headers
Refer: https://community.akamai.com/blogs/EmilioMurillo/2016/04/21/troubleshooting-with-fiddler

Simple test page on book.hollandamerica.com to make sure you can see Akamai Stage
https://book.hollandamerica.com/utilities/SessionDump.jsp

Using Akamai Pragma headers to investigate or troubleshoot Akamai content delivery

Use ModifyHeaders for Firefox
Action: Add
Name: Pragma
Value: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no
Comment: Akamai Pragma

Refer: https://community.akamai.com/community/web-performance/blog/2015/03/31/using-akamai-pragma-headers-to-investigate-or-troubleshoot-akamai-content-delivery

Akamai servers are configured to provide plenty of useful information using HTTP headers - the key to extracting this information is making a HTTP request along with some custom Pragma headers. Below is the most commonly used set of Pragma request headers:

Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-get-request-id

And here is the explanation of what can be extracted using these headers as a response from Akamai Edge Server:

X-Check-Cacheable: NO
This header simply indicates whether this particular URL can be cached on Akamai or not.

X-Akamai-Request-ID: 2256a92
Request ID provides a unique request identifier on Akamai network. Value of this header can be used to trace a request on Akamai network by support representative.

X-Cache: TCP_MISS from a165-254-246-9.deploy.akamaitechnologies.com

X-Cache-Remote: TCP_HIT from a23-67-252-148.deploy.akamaitechnologies.com
Values of X-Cache headers mention which Akamai servers participated in serving your request. TCP_MISS/TCP_HIT will tell whether the content was served from cache (TCP_HIT) or if the machine had to go forward to fetch the file from somewhere else (TCP_MISS). X-Cache headers can also give an IP address of Akamai machine serving the content - as in the example above - the machines serving content are 165-254-246-9 and 23-67-252-148 - just replace dashes with dots and you will get an exact Akamai IP address!

A few other useful cache responses:

TCP_HIT: Object was fresh in cache and object from disk cache.
TCP_MISS: Object was not in cache, server fetched object from origin.
TCP_REFRESH_HIT: Object was stale in cache and was successfully refreshed with the origin on an If-Modified-Since request.
TCP_REFRESH_MISS: Object was stale in cache and refresh obtained a new object from origin in response to our IF-Modified-Since request.
TCP_REFRESH_FAIL_HIT: Object was stale in cache and failed on refresh (couldn't reach origin) so the stale object was served .
TCP_IMS_HIT: IF-Modified-Since request from client and object was fresh in cache and served.
TCP_NEGATIVE_HIT: Object previously returned a "not found" (or any other negatively cacheable response) and that cached response was a hit for this new request.
TCP_MEM_HIT: Object was on disk and in the memory cache. Server served it without hitting the disk.

X-Cache-Key: /L/152/14351/1d/origin-www.akamai.com/index2.html * - depracated
This header will return a Cache Key value which is used to store content on Akamai network.

There's also crucial information in the X-Cache-Key (Thank you Iain Hunneybell!):

That /1d/ means the item is on a 1 day cache setting. Useful if you want to check. Useful ones to look out for are:
0s: 0 second cache meaning serve from cache but revalidate on every request, e.g. check origin but don't re-download unless changed
000: Non-cacheable...a key code to recognise
5s: 5 (or however many) seconds
5m: 5 (or however many minutes)
5h: You'll never guess this one!

Small point:
akamai-x-get-cache-key has actually been deprecated because it doesn't indicate if a query string has been ignored in the cache key. It also shows serial, CP Code and TTL, which are not part of the cache key used to store the object.
While the information given in X-Cache-Key is useful it can be misleading, for example the TTL shown won't reflect any baseline value being overridden by origin cache-control or edge control headers. It can also show extra query parameters added by internal processes like RUM or FEO.

You should use akamai-x-get-true-cache-key and X-True-Cache-Key to get the real cache key used to store the object. It will represent the parts of the original URI used to form the key after any metadata rule processing.

Akamai Pragma HTTP headers can be injected into your request by one of the browser extensions or one of HTTP debugging applications. Some most popular examples include:

- Charles Proxy - HTTP/Web Debugging Proxy software
- Fiddler - free web debugging proxy
- Modify Headers Firefox plugin
- Firebug - another powerful Firefox plugin
- For Chrome, try experimenting with this extension: CDN Headers & Cookies - Chrome Web Store (Thank you Dwi Taniel!)