reverse proxy that caches post requests

nurettin asked:

I understand that varnish caches “GET” and “HEAD” requests by default.

My backend servers fail when I do a get request that is too long, so I made them respond to POST instead of GET. This works great, but I need a reverse proxy which can be configured to cache POST responses just like GET.

Are there any reverse proxies that can cache these post requests?

My answer:

Reverse proxies cache responses, not requests. In any case, it’s not realistic to cache a response to a POST request. The HTTP specification really doesn’t allow for it, since the very act of sending a POST request is supposed to invalidate any cache for that URL, and the response is non-cacheable by default. You are supposed to send a redirect as a response to the POST request if you want the response cached.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.