0
votes

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)

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." 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". Now I want to parallelize hostnames and have something like "static1.mydomain.com, static2.mydomain.com etc."

I added those CNAMEs to my CloudFront Distribution and also to CloudFlare like this: "static1.mydomain.com is an alias of 1234567.cloudfront.net"

I assume it should be working now or am I missing something?

1
Then you have to change your HTML, JS, etc. code so that some requests use the new hostname. But note also... have you enabled HTTP/2 on your CloudFront distribution? Because that should enable some parallelism right there. - Michael - sqlbot
I changed the HTML but the links with the new CNAMEs return 404 not found pages. HTTP/2 is also enabled. No success though. - user2907536

1 Answers

0
votes

CloudFront should serve files to any domain alias that is setup in the distribution 'alias' list section. 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.

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.