Question

I am trying to configure some assets on the Rackspace Cloudfiles CDN to be sent to clients with gzip encoding. As far as I can tell according to their website (http://www.rackspace.com/blog/cloud-files-cdn-compresses-at-the-edge/), any request with 'Accept-encoding: gzip' and 'Accept: application/x-javascript' will be sent down with gzip. The request is being made with 'accept-encoding: gzip', but 'accept: /'.

Is there a way for me to get the browser to request the JS file as 'application/x-javascript', or do I need to do something at the file level to send the resource down with the right mime-type? Same for CSS.

Was it helpful?

Solution

We solved this by explicitly setting "Content-Type: application/x-javascript" in our deployment script using the Rackspace Cloud Files API Ruby gem. This solved the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top