Azure CDN adding pragma:no

I've set up an Azure CDN using the Standard Akamai tier. My origin is a Web App. I've set up the cache-control header in my web.config as follows:

<clientCache cacheControlMode="UseMaxAge" cacheControlCustom="public" cacheControlMaxAge="30.00:00:00" />

In my markup, I'm hitting my image file with the following code:

<img src="https://xxxx.azureedge.net/Content/Images/Turtle.jpg?v=1.0.0.27987">

When I do so, I get the following response headers:

cache-control:public, max-age=2591903 
content-length:2321435 
content-type:image/jpeg 
date:Mon, 03 Apr 2017 19:34:23 GMT 
etag:"2e7a1f1690a9d21:0" 
last-modified:Thu, 30 Mar 2017 19:59:05 GMT 
pragma:no-cache 
server:Microsoft-IIS/8.0 status:200 vary:Accept-Encoding x-powered-by:ASP.NET

Notice the pragma:no-cache. I have NO IDEA where that is coming from. This is definitely NOT in my origin's response to load the cache. If I hit the origin, I see the following headers sent for the same image:

Accept-Ranges:bytes
Cache-Control:public,max-age=2592000
Content-Length:2321435
Content-Type:image/jpeg
Date:Mon, 03 Apr 2017 19:41:50 GMT
ETag:"2e7a1f1690a9d21:0"
Last-Modified:Thu, 30 Mar 2017 19:59:05 GMT
Server:Microsoft-IIS/8.0
X-Powered-By:ASP.NET

This means that when hitting the CDN, instead of serving this image from http cache, it's sending the ETag and I'm wasting a HTTP roundtrip. I'm assuming that the culprit is the pragma:no-cache header that is sent, which is overriding the cache-control header. My questions are:

  • Why is the Azure CDN adding this pragma:no-cache header when serving my image?
  • Is the pragma:no-cache the reason we're seeing the 304/ETag validation instead of serving from http cache?
  • Thanks!

    Edit: I've also tried removing the tag from the web.config. I'm still seeing an ETag transmitted for the image instead of serving it from the browser http cache.

    链接地址: http://www.djcxy.com/p/62726.html

    上一篇: Azure CDN + Asp.net MVC Cloud Service压缩包无法正常工作

    下一篇: Azure CDN添加附注:无