Cloudflare + Cloudfront

have EC2 with ELB setup with AWS and currently have cloudflare for CDN. Already serving JS/CSS/Images from cloudfront. Would like to move rest of CDN to cloudfront but keep the security and WAF, DNS features of cloudflare. can this be achieved?

Yes, but I would not recommend this.

You can set up a page rule which disables cache for everything and sets the security setting you want. But then all files must be served from CloudFront, which is more expensive and also slower IF proxied through Cloudflare, as it adds a round Trip.

I would like to recommend you to not completely disable the cache at Cloudflare, but maybe set the Edge TTL to the lowest you can to update the cache frequently and still be able to profit from Cloudflares cache if a lot of requests are coming in.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.