Routing POSTs vs GETs in Load Balancer

An unusual idea/problem: we have legacy applications that we’d like to scale geographically to reduce response times. Unfortunately, these applications are unaware of read/write split for database queries making it difficult to accomplish this scaling with read replicas at origins around the world. We want to take a different approach to take advantage of how the applications don’t need to perform database updates on GETs and can therefore at least quickly serve GET requests from origins around the world.

Instead of using Cloudflare Load Balancing to send visitors to the fastest/closest origin, is there a way to route read (GET) requests in this way but always send write (POST) requests to a specific origin that’s able to perform database writes?

1 Like

You can use CF Load Balancer custom rules Create custom rules · Cloudflare Load Balancing docs with various override options Load Balancing actions · Cloudflare Load Balancing docs

2 Likes

Brilliant, thank you eva2000

1 Like

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