Looking for performance optimization of website across geographies? CDN (Content Delivery Network) like CDNetworks, CloudFlare, Amazon CloudFront, EdgeCast or Windows Azure are definitely one of the key area that should be focused. But the point is how can we validate whether a resource is served from CDN or not??
We are using AKAMAI as CDN in few of our websites & trying to check Request/Response headers but unfortunately can’t figure that out whether a particular web resource if served from our web server or the CDN.
Doing a little research, does a trick for us. If we can send below PRAGMA as header along with the requested resource to the outgoing GET request, it exposes the caching details of that resource and whether its a cache hit or miss.
Pragma: 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
In order to make request for a particular resource with custom header, we can use tools like Fiddler. The tool provides an option to create a HTTP request with flexibility of adding custom headers & method and proves quite handy in this case.
Below are the screenshot to assist you further: