Static content compression over Azure Web Role & Azure CDN not working
My website is hosted on an Azure WebRole and the content is fetched using Azure CDN . The main HTTP request itself is compressed, but the static content (css & js are the main issue here) isn't. The request is sent with 'Accept-Encoding: gzip,deflate,sdch' header, but the response is missing the 'Content-Encoding: gzip' and 'Vary: Accept-Encoding' headers. It's important to note that this happens when fetching the content both from and the CDN and directly from the WebRole .
These are the relevant web.config sections:
<urlCompression doDynamicCompression="false" doStaticCompression="true" />
<httpCompression directory="%SystemDrive%inetpubtempIIS Temporary Compressed Files" noCompressionForHttp10="false" noCompressionForProxies="false">
<scheme name="gzip" dll="%Windir%system32inetsrvgzip.dll" />
<dynamicTypes>
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="image/svg+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
As you can see in the config, I've enabled compression for proxies and for HTTP 1.0, but it doesn't seem to be the problem.
Anyone has an idea what's wrong here?
链接地址: http://www.djcxy.com/p/62720.html上一篇: MVC捆绑Azure CDN