Perform Backend Request with a Body

Florian Gilcher flo at
Thu Jul 15 12:39:50 CEST 2010


This is kind of similar to the question "can I cache POSTs"?

My situation is the following: We use ElasticSearch[1] for search indexing and would like to put a varnish in front of it, to cache recurring queries for some time (we do a lot of automated queries). Now, ElasticSearch has a rather 'creative' HTTP Api, mostly due to their complex Query system, wrapped into a JSON format[2].

The ElasticSearch backend expects this JSON as body of either a GET or a POST request. The first is non-compliant, because servers should ignore bodies on GET-requests, the second is non-compliant because POSTs are not intended for reading data *sigh*. Nevertheless, thats what I am stuck with.

Now, back to varnish: it seem like varnish always strips the body before emitting a backend request if it is not in pass mode. Is there any way to circumvent this? I already send a special header containing a hash of the body to make it easier for varnish to lookup the object to this request. But without passing on the body, this is futile.

Is there a solution using VCL for this or should I look for other solutions?


[1]: <>
[2]: <>
Florian Gilcher

smtp:   flo at
jabber: Skade at
gpg:    533148E2

More information about the varnish-misc mailing list