3

I am not able to get Azure's CDN to pass along compressed files from the source.

Original file (gzips just fine:)

http://www.schooldigger.com/cdn/clientscript/SchoolDigger.1.45.min.js

>curl -I -H "Accept-Encoding: gzip,deflate" http://www.schooldigger.com/cdn/clientscript/SchoolDigger.1.45.min.js

returns

HTTP/1.1 200 OK
Cache-Control: max-age=1209600
Content-Length: 57390
Content-Type: text/javascript
Content-Encoding: gzip
Last-Modified: Mon, 26 Nov 2012 04:45:00 GMT
Accept-Ranges: bytes
ETag: "31143cb90cbcd1:0"
Vary: Accept-Encoding
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Mon, 26 Nov 2012 17:25:25 GMT

CDN File (does not return gzipped):

http://cdnaz.claarware.com/clientscript/SchoolDigger.1.45.min.js

>curl -I -H "Accept-Encoding: gzip,deflate" http://cdnaz.claarware.com/clientscript/SchoolDigger.1.45.min.js

returns:

HTTP/1.1 200 OK
Cache-Control: max-age=1209600
Content-Length: 150551
Content-Type: text/javascript
Accept-Ranges: bytes
ETag: "31143cb90cbcd1:0"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Age: 43723
Date: Mon, 26 Nov 2012 17:31:50 GMT
Last-Modified: Mon, 26 Nov 2012 04:45:00 GMT
Expires: Mon, 10 Dec 2012 05:23:07 GMT
Connection: keep-alive
Pete C
  • 31
  • 2

1 Answers1

0

How the compression is enabled in your content? Based on your email it is not clear if you are using a Web Role to compress your content which is needed with Windows Azure.

As Described here, about Windows Azure CDN with compressed content?, Windows Azure CDN will not modify (or add) compression to your objects. The Windows Azure CDN respects whatever compression is provided by the origin based on the "Accept-Encoding" header. If you are using hosted-service object delivery, you can configure IIS to return compressed objects.

Here is an article on how to enabled compression with your content as well as some SO discussion on this regard.

Community
  • 1
  • 1
AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • Thanks for your response, Avkash. I've read through the links you've provided (before and after I've posted this question) and I think I'm setup properly. The origin content is hosted in an Azure Cloud Service running an ASP.NET app and is compressed (see my first CURL in the question above.) By default, the IIS server in the Cloud Service compresses static content. I added a directive to my web.config to add dynamic content compression. Everything comes back gzipped from the origin. Did I miss something in your response? – Pete C Nov 27 '12 at 01:45
  • Pete, it seems your Accept-Encoding header is stripped due to some configuration. Can u please try to use main CDN url while passing resource as query paramteter to see the results. Also does your caching setup include etag dependent caching or something specific as described here http://stackoverflow.com/questions/10522714/azure-cdn-enabling-http-304-caching-with-etag-hosted-web-role – AvkashChauhan Nov 27 '12 at 02:53
  • Avkash, I'm not sure why the Accept-Encoding header would be stripped. I'm using Azure CDN out of the box against an origin that is compressing properly. I saw the post about issues with axd files and adding a group=core.js query param, but that didn't compress either. – Pete C Nov 27 '12 at 18:06
  • 2
    To be honest, I gave up and moved to another CDN, which works great. Thanks for your help. – Pete C Nov 27 '12 at 19:30