nginx subrequests / background operations

Ameir Abdeldayem ameirh at
Sat Jun 7 05:36:59 UTC 2014

Hello Maxim,

Thanks for your feedback.  Yes, "proxy_cache_use_stale updating" does do a
great job, but "the first request" is the first request per TTL, which
relates to the problem we're facing.

We run some high-profile sites, oftentimes with low TTLs (1m or so).  The
queries we run on the backend are very complex and time-consuming, and
oftentimes take on the order of 10s to complete.  Because of the low TTL,
although most users get immediate responses, the user who makes the request
when the entry is EXPIRED has to suffer.

Additionally, each page load requests several resources through nginx, and
it's happened a number of times that a single user will be the victim of
hitting more than one EXPIRED entry, hitting the backend more than once
(very unlucky, I know).  The end result is user complaints, which would be
mitigated entirely if we could serve the STALE entry before updating it.

If you have any thoughts on how to improve performance in this scenario, I
would love to hear them.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list