Hi Maxim,
Thank so much for your response. You are correct, and the configuration of
proxy_cache_use_stale updating was present.
Stale while revalidate is a great option, and we use in a websites with more
than 50 millions users/month.
This graph is our time to waiting to delivery pages to our users. We implement
stale while revalidate in the beginning of Mai and we had an improvement of 30%.
[cid:179acb8c-85a4-4e56-ad12-b4953a6475bd]
Abraço,
Rafael Cirolini
Sup Programmatic & Digital Services
Terra Global
De: nginx <nginx-boun...@nginx.org> em nome de Maxim Dounin <mdou...@mdounin.ru>
Enviado: quarta-feira, 7 de junho de 2017 11:26:45
Para: nginx@nginx.org
Assunto: Re: Stale While Revalidate Expires
Hello!
On Tue, Jun 06, 2017 at 07:33:24PM +, Rafael Cirolini wrote:
> We've just updated to 1.12 to use the stale-while-revalidate option.
>
> The application is who sends the cache-control header, like this:
> cache-control:max-age=180, stale-while-revalidate=60, stale-if-error=864000
>
> If I understood how SWR works, the user shouldn't receive stale content after
> 180+60 seconds.
>
> But we are seing stale content after this time.
> X-Cache-Status: STALE
>
> Our DevOps team did a debug:
> 2017/05/22 15:14:31 [debug] 21376#21376: *44 http file cache expired: 4
> 1495476646 1495476871
> 2017/05/22 15:14:31 [debug] 21376#21376: *44 http upstream cache: 4
> 2017/05/22 15:14:31 [debug] 21376#21376: *44 http file cache send:
> /var/cache/nginx/d/d2/fb19e1c85db7bda5c92ce21530bf5d2d
> 2017/05/22 15:14:31 [debug] 21376#21376: *44 http ims:1491861925 lm:1491861925
> 2017/05/22 15:14:31 [debug] 21376#21376: *44 http script var: "STALE"
>
> The correct answer should be EXPIRED after the max-age+SWR time.
>
> It looks reasonble to you?
The behaviour depends on whether you use "proxy_cache_use_stale
updating" in your configuration or not:
- If it is explicitly configured, it takes precedence over
"Cache-Control: stale-while-revalidate=", and nginx will use any
stale response available.
- If not configured, nginx will follow "stale-while-revalidate="
specified in the response.
The debug log provided suggests that the configuration uses
"proxy_cache_use_stale updating" and
"proxy_cache_background_update on".
--
Maxim Dounin
http://nginx.org/
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Esta mensagem e seus anexos se dirigem exclusivamente ao seu destinatário,
podem conter informaç?o privilegiada ou confidencial e s?o de uso exclusivo da
pessoa ou entidade de destino. Se n?o for destinatário desta mensagem, fica
notificado de que a leitura, utilizaç?o, divulgaç?o e/ou cópia sem autorizaç?o
pode estar proibida em virtude da legislaç?o vigente. Se recebeu esta mensagem
por engano, pedimos que nos comunique imediatamente por esta mesma via e, em
seguida, apague-a.
Este mensaje y sus adjuntos se dirigen exclusivamente a su destinatario, puede
contener información privilegiada o confidencial y es para uso exclusivo de la
persona o entidad de destino. Si no es usted él destinatario indicado, queda
notificado de que la lectura, utilización, divulgación y/o copia sin
autorización puede estar prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le pedimos que nos lo comunique inmediatamente
por esta misma vía y proceda a su exclusión.
The information contained in this transmissión is privileged and confidential
information intended only for the use of the individual or entity named above.
If the reader of this message is not the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this communication
is strictly prohibited. If you have received this transmission in error, do not
read it. Please immediately reply to the sender that you have received this
communication in error and then delete it.
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx