Welcome! Log In Create A New Profile

Advanced

proxy_cache: Activity vs. Validity

September 29, 2010 06:20AM
Hi,

I am new to nginx (and to caching proxies), and I'd like to make sure I use the Proxy module correctly. As far as I understand, the following directive

proxy_cache_path /data/nginx/cache/one levels=1 keys_zone=one:10m inactive=10m max_size:500m;

asks nginx to cache a certain page for 10 minutes. If it is not requested again within that time span, the page is removed from the cache. I assume that without the inactive parameter, pages remain in the cache until either the maximum zone size (10 MB) or the maximum cache size (500 MB) is reached.

Now I wonder how the proxy_cache_valid contributes to the caching mechanism. The wiki (http://wiki.nginx.org/NginxHttpProxyModule#proxy_cache_valid) says that there is no persistent caching without proxy_cache_valid – but what does that mean exactly? A configuration without proxy_cache_valid works (pages are cached, and cached pages are sent back to the client), so what is different with proxy_cache_valid?

Also, how does proxy_cache_valid relate to the inactive parameter above? If, for example, I set proxy_cache_valid for for any response to 10 minutes, but the inactive parameter to 20 minutes, cached pages will remain in the cache for 10 minutes after they have become invalid (i.e. if the page is requested 15 minutes after the initial request, the existing cache entry is ignored). If this assumption is correct, it probably makes no sense to set the inactive parameter to a higher value than proxy_cache_valid.

Best regards,
Jan
Subject Author Posted

proxy_cache: Activity vs. Validity

janedenone September 29, 2010 06:20AM

Re: proxy_cache: Activity vs. Validity

janedenone September 30, 2010 04:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
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