Search code examples
wordpressamazon-web-servicesamazon-s3cdnamazon-cloudfront

How do I purge my root domain from Amazon Cloudfront CDN - and should I?


Just realizing that I may have erred in setting up Amazon Cloudfront (origin pull), not S3 buckets.

When navigating to the homepage, http://www.occupyhln.org (WordPress domain), the browser tries to connect to the A-name I set up, which is http://cdn.occupyhln.org ... and eventually loads as www.occupy in the browser address bar.

However, when I type in http://cdn.occupyhln.org, that loads in the address bar as well. I was under the impression that this isn't recommended either.

Am I correct in assuming this is adding an unnecessary redirect and slowing down page load times? I thought I only wanted my static files to be hosted by Amazon (.js, .css, .jpg, .png, etc.).

What can I do to remedy this error -- assuming it is one -- and prevent it from happening in the future? Any guidance would be appreciated!


Solution

  • I just saw the cdn.occpyhin.org when I went to that page... so your mistake is that you should have created a CNAME aka alias rather than an A Record which resolves to the domain... in this case a sub domain cdn.occpyhin.org. You should use the plugin W3 Total Cache. It takes a lot of guess work out of optimizing your site. In addition, modifications that W3 Total Cache can help you will are just as important (if not more important) as CDN.

    If your not using AWS Route 53 for your name servers I would recommend doing that.