Anonymous User
September 11, 2009 09:18AM
Maxim Dounin wrote:

>> So when I use "proxy_cache_use_stale off;" which is default, nginx will
>> request the file again from the backend, if the time in
>> "proxy_cache_valid" is over?
>
> Yes.

This did not work for me at all.

>>>> For some reason my cache still contains a file, that has been
deleted
>>>> on my backend 10 hours ago. Both, proxy_cache_valid and inactive=
>>>> are set to 2h. Maybe the two settings have different meanings and I
>>>> do not understand yet.
>>> Which version? From the description it looks like a bug fixed in
>>> 0.8.14:
>>>
>>> *) Bugfix: an expired cached response might stick in the "UPDATING"
>>> state.
>>>
>>> If you see this in 0.8.14 - please provide more details.
>> I am using the stable version (0.7.61). Do I have to update to 0.8.14 in
>> order to get this working? I'm not sure whether it's my config or a bug.
>
> Stable doesn't have this fix yet, so you either have to upgrade or
> wait for fix to be merged. No idea when merge will happen though.
>

So I updated to 0.8.14, but still the files were in the nginx cache for
hours even though I deleted them on the backend.
Then I stumbled on this topic: http://forum.nginx.org/read.php?2,2182
After adding "proxy_ignore_headers Expires Cache-Control;" to my config,
the cache started working as expected.
Especially this part is interesting:

This just means that upstream's caching instructions are more important
than proxy_cache_valid, right?

Yes, the order is
X-Accel-Expires
Expires/Cache-Control
proxy_cache_valid

I think this should be added to the wiki to "proxy_cache_valid".
There already is a small hint to that behavior in the wiki at
"proxy_cache" but I think this is not enough (at least it wasn't for me).

Well, now it works perfectly and I'm happy :)
Subject Author Posted

question about proxy_cache_valid

Anonymous User September 10, 2009 11:08AM

Re: question about proxy_cache_valid

Maxim Dounin September 10, 2009 11:48AM

Re: question about proxy_cache_valid

Anonymous User September 10, 2009 12:44PM

Re: question about proxy_cache_valid

Maxim Dounin September 10, 2009 02:00PM

Re: question about proxy_cache_valid

Anonymous User September 11, 2009 09:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready