On Tue, Mar 13, 2012 at 4:08 PM, Greg Grensteiner <email@example.com> wrote:
>>> Does the srcache_store_max_size directive work for you?
> No, this will not work. What I need is the size of the currently processing
> request that is being written to the cache. I need this value so I can
> compare it to the Content-Length header sent from my upstream app server.
> If the size of the request being sent to srcache_store matches the
> Content-Length from my app server then it's a valid result to send to the
The srcache_store thing does not send the response data piece by
piece. It always buffers the whole response. So if it does not see the
(explicit) end of the output stream, it will just throw away the
buffered data and does not touch the cache at all.
Do you mean that your backend server can send extra data than the size
specified by its Content-Length response header?
>>>This wouldn't be an issue if the proxy_pass would throw an error/timeout
>>> it get a short return, do you know of any way to do that?
>> I'm not sure what you're talking about here :)
> What I'm talking about is this
> where proxy_pass doesn't throw an error if the Content-Length doesn't match
> the size of the return.
Okay, if ngx_proxy cannot detect the connection abortion errors here,
then ngx_srcache cannot know either. I think we should fix ngx_proxy
in the first place rather than doing work-around on the ngx_srcache
But anyway, ngx_srcache can do a double-check on the data size if a
Content-Length response header is present. Do you have the tuits to
contribute a patch for ngx_srcache?