Proxy_cache_key and $content_length

Hi,

I’d like to put $content_length in proxy_cache_key in order nginx to
check
if file had changed and send it instead of old file if it’s case.

But the $content_length is always empty. Why ?

Or do you have another solution for my problem ?

Thanks,

Thibaut

Posted at Nginx Forum:

Hi
That’s a good idea but I think it’s not possible
The key is set before request is sent to backend but it can only know
the content length after the request is sent to backend (catch 22)

Ok, it’s what I supposed but I was not sure.
Is there an alternative ?

Posted at Nginx Forum: