Cloudflare alternative for cloudfront Origin groups

We are currently using AWS Cloudfront and would like to move it to Cloudflare
we use Origin groups to route traffic to two origins in case one fails, it will be automatically
routed to others depending on the status code

we have added this for certain URL paths using the behaviors
can this be achieved with Cloudflare as well, i saw the origin rules for using different origins
according to the URL but failover is not present

Also, we use aws lambda@edge to route the traffic to two different origins can this be achieved as well
with Cloudflare workers

We need to trigger worker only on cache miss before contacting the origin, I don’t see a similar approach with workers trigger points,
saw the same trigger points as lamabda@edge with Akamai edge workers as well but Cloudflare workers seems to be only useful for hosting pages
and not really useful for modifying the requests and responses in conjunction with the CDN

Cloudflare offer Load Balancing, which also supports failover and custom rules. You can use an Origin rule to direct certain traffic to the Load Balancer.

Workers run before the Cloudflare Cache, but you can check if the required asset is in the cache within the worker, and only go back to the Origin and execute your application logic on cache miss. Otherwise the worker can just return the object from cache.

While there used to be a Workers Sites feature, that is all but defunct at this stage. You can see some examples of applications built with workers here, and they are much more than static websites.

Depending on what you are trying to modify, no-code option like Transform Rules are a quick and easy option, but Workers can do pretty much anything you can think of to a HTTP transaction.

1 Like

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