1

I use ngx_http_proxy_module with proxy_ignore_client_abort to cache files. So when client close connection nginx will continue copying file from backend to current server.

But when another user will try to get this file (which is still copying) nginx will go to backend to get new copy of file and will try to cache it too.

I can use proxy_cache_lock to prevent it. But it is bad idea, because file can be very large and it will get much time to wait while file will be cached.

How can I tell nginx to read this temporary file and not wait until the file is cached?

1 Answer 1

1

You are looking for delivering a stale object of the cache. This can be done in case of an error, timeout to the back-end or while updating.

proxy_cache_use_stale updating error timeout;
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .