Hi,
I am using nginx as a reverse proxy and using the proxy-cache, I use the request body as a cache key as shown below.
location ^~ /mycachepath {
proxy_pass http://upstreamservers;
proxy_buffers 8 32K;
proxy_buffer_size 64K;
proxy_cache proxy-cache;
proxy_cache_key "$scheme$host$request_uri|$request_body";
proxy_cache_valid 200 1m;
proxy_cache_methods POST GET;
proxy_ignore_headers Cache-Control;
add_header X-Cache-Status $upstream_cache_status;
}
However, I observe that smaller request bodies the cache works perfectly but if the request body gets too big then it will actually *always* return the cached version. Does anyone have any idea what's going on and if someone also has come across a similar issue ? There is nothing in the logs except for this statement - "[warn] 29768#0: *2329 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000009," for a given request.
Any help is much appreciated.
Thanks!