1

Here is an example: http://tools.pingdom.com/fpt/#!/cp0wwy/http://www.shearcomfort.com/Car-Seat-Covers_CDN.asp

Pick any image, say 2014_subaru_outback_mini.jpg then you can see it appears twice: once from cloudfront with 0 bytes and the second time from the actual domain shearcomfort.com

Can anyone explain what is going on here and how to make all the assets come only from cloudfront and not from the home domain?

2 Answers 2

5
+50

Your CDN URLs are returning 301 Redirects.

curl -I http://d3cerlni7xmxaw.cloudfront.net/images/stars/images/2starrating.gif

HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Content-Length: 186
Connection: keep-alive
Location: http://www.shearcomfort.com/images/stars/images/2starrating.gif
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Tue, 20 May 2014 17:43:02 GMT
X-Cache: Miss from cloudfront
Via: 1.1 45f9deebd67d2bd40b8384feda6e6e32.cloudfront.net (CloudFront)
X-Amz-Cf-Id: dcbTEOwj48JfPD8YrvKrk4m2-OCkCAAABdqnwGxBOfRkmdLLpl7ErQ==

I'd bet you pointed your CloudFront distribution at shearcomfort.com rather than www.shearcomfort.com. You appear to 301 URLs on that domain to the www version.

1
  • Thank you, been bashing my head against the desk on this one
    – Collins
    Jul 18, 2017 at 10:52
2

The 301 Moved Permanently can also happen if you're running a https only site and 301 redirect http visitors to https (and therefore also cloudfront).

There is a setting under origin in cloudfront "Origin Protocol Policy" make sure this is set to "Match Viewer" so that cloudfront requests the https version from your origin server and not http (as is default).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .