Transform POST request to GET and pass body in URL

Hello,

I am using Varnish as a cache and reverse-proxy to distribute requests
between different backend workers. The workers expect some parameters,
that can be passed either through GET or POST.

The way Varnish works is by caching and distributing requests based on
the URL. So all GET requests are fine, because the parameters are in
the URL.

However, POST requests are not, because parameters are within the
body, so requests are not cached and distributed to one backend worker
only, which then gets all the load.

What I’d like to do is transform POST requests to GET requests, by
encoding the POST body content in the URL and pass a subsequent GET to
the Varnish cache.

Do you think this is possible? If so, how?

Many thanks for your help!

Regards,
Kip

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs