Debugging Akamai

Akamai just works, … most of the time. But sometimes you have to check what’s going on, and Akamai gives you a handy tool for this.

There is an HTTP request header that tells Akamai to respond with some internal information.

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

With this request header Akamai includes this in the response header

X-Cache: TCP_MISS from a84-53-161-127.deploy.akamaitechnologies.com (AkamaiGHost/9.6.2.0.1-25325260) (-)
X-Cache-Key: S/L/16382/612780/0s/www.yourdomain.de/ cid=what_TOKEN=dings_
X-Cache-Key-Extended-Internal-Use-Only: S/L/16382/612780/0s/www.yourdomain.de/ vcd=1948 cid=what_TOKEN=dings_
X-True-Cache-Key: /L/www.yourdomain.de/ vcd=1948 cid=what_TOKEN=dings_
X-Akamai-SSL-Client-Sid: lZWwRTj17XXXXXXXXXU5Cw==
X-Check-Cacheable: NO
X-Akamai-Request-ID: f82516c

Some important parts:

  • TCP_MISS shows that Akamai didn’t use it’s cache for this request, but the origin
  • X-Cache-Key shows what Akamai used to reference the cache position. In this case the url was http://www.yourdomain.de/?what and a cookie named TOKEN was included in the cacheID (“cid=…”)

Web Audio Silence

Problem: I had problems with an audio driver (no not on Linux). The sound started with a delay after every gap of silence. This bug cuts off about 1/2 of a second of the attack of the sound. This is a problem when you try to make music in particular.

Workarround: I made a little webpage that plays “Total Silence” or “Almost Silent” sound. This keeps the sound driver busy and prevents the driver from shutting down the sound.

–> http://seven.mail.at/silence.html

Google Maps Marker on Mobile

Problem: A responsive webapp shows a google map with markers that are clickable. On desktop everything works as expected, but on mobile the markers are not clickable.

Discussion: After debugging with chrome remote inspector, I found that a div->frame with opacity:0 was lying above (explicit z-index:2) the clickable markers.

I don’t know what this frame is for, but it covers the markers and its click events.

Workaround: The frame is only loaded when the user is logged into google. You can remove this frame by removing “signed_in” from the script tag.

Version: https://maps.googleapis.com/maps/api/js on 23.2.2016. Chrome 48 on Android 5.1.1,

Google Map from RSS Feed

Problem: Google had a nice feature to build google maps from rss geo information with a simple iframe tag, but this service is discontinued.

<iframe width="920" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" 
 src="https://maps.google.com/?q=http:%2F%2Ftothepin.blogspot.com%2Ffeeds%2Fposts%2Fdefault&amp;ie=UTF8&amp;t=t&amp;source=embed&amp;output=embed">
</iframe>

You could actually add ?q=rssfeed to the maps.google.com url and it produced a map from all geo data in this rss feed.

Solution: The new api for google maps is different but you can still do the same. Here some sample code:

<script src="//maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
    function initialize() {
        var myLatlng = new google.maps.LatLng(48.2084900,16.3720800);
        var mapOptions = {zoom: 4, center: myLatlng }

        var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

        var georssLayer = new google.maps.KmlLayer({
            url: 'http://tothepin.blogspot.com/feeds/posts/default?alt=rss'
        });
        georssLayer.setMap(map);
    }

    google.maps.event.addDomListener(window, 'load', initialize);
</script>
<style>
#map-canvas { width:800px; height:500px; }
</style>
<div id=map-canvas>Map</div>