简体   繁体   English

AWS CloudFront + CloudFlare:使用备用域名(CNAME)

[英]AWS CloudFront + CloudFlare: Using Alternate Domain Names (CNAMEs)

I have the following setup: - A WordPress Site hosted on hostgator.com - DNS managed through cloudflare.com - Amazon CloudFront used as CDN for Media, CSS & JS files (configured through W3 Total Cache WordPress Plugin) 我具有以下设置:-托管在hostgator.com上的WordPress站点-通过cloudflare.com管理的DNS-用作CDN的Amazon CloudFront用作媒体,CSS和JS文件的CDN(通过W3 Total Cache WordPress插件配置)

On the pingdom.com Website speed test I get the message "This page makes 43 parallelizable requests to "mydomain.com". Increase download parallelization by distributing these requests across multiple hostnames." 在pingdom.com网站速度测试中,我收到消息“此页面向“ mydomain.com”发出了43个可并行化的请求。通过将这些请求分配到多个主机名来提高下载并行化。” So this is what i'm trying to accomplish. 所以这就是我想要完成的。

Amazon CloudFront is already working and serving files like this "1234567.cloudfront.net/wp-content/.../image.png". Amazon CloudFront已经可以工作并提供诸如“ 1234567.cloudfront.net/wp-content/.../image.png”的文件。 Now I want to parallelize hostnames and have something like "static1.mydomain.com, static2.mydomain.com etc." 现在,我要并行化主机名,并使用类似“ static1.mydomain.com,static2.mydomain.com等”的名称。

I added those CNAMEs to my CloudFront Distribution and also to CloudFlare like this: "static1.mydomain.com is an alias of 1234567.cloudfront.net" 我将这些CNAME添加到了CloudFront发行版以及CloudFlare中,如下所示:“ static1.mydomain.com是1234567.cloudfront.net的别名”

I assume it should be working now or am I missing something? 我认为它现在应该可以工作,还是我丢失了什么?

CloudFront should serve files to any domain alias that is setup in the distribution 'alias' list section. CloudFront应该将文件提供给在“别名”列表部分中设置的任何域别名。 Read the fine print to see how to separate between multiple aliases. 阅读细则,以了解如何在多个别名之间进行分隔。 Once you set it up and save, add the domain aliases to cloudflare and you should get the same file response on both aliases. 设置并保存后,将域别名添加到cloudflare,并且两个别名都应获得相同的文件响应。

Note: in the last 12 months or so, we had significant improvements in how modern browsers fetch files and domain sharding is now considered a thing of the past . 注意:在过去的12个月左右的时间里,我们在现代浏览器获取文件和域分片的方式已成为过去的事情上有了重大改进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM