I'm not familiar with CloudFront, or some of the other details of what you're talking about. However, is it not simply that when something is served from a cache, your script is not creating/adding to the response header because the cache mechanism itself is in fact creating the response header for the cached resource? Or perhaps I just don't understand all the 'edge' business ; )