# Proxy\_cache: Activity vs. Validity

**URL:** <https://www.ruby-forum.com/t/proxy-cache-activity-vs-validity/195744>\
**Category:** NGINX\
**Created:** [September 29, 2010, 12:21pm UTC](https://www.ruby-forum.com/t/proxy-cache-activity-vs-validity/195744 "2010-09-29T12:21:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![janedenone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/da6949/32.png) [@janedenone](https://www.ruby-forum.com/u/janedenone)\
**Post date:** [September 29, 2010, 12:21pm UTC](https://www.ruby-forum.com/t/proxy-cache-activity-vs-validity/195744/1 "2010-09-29T12:21:57Z")

</div>

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  
([Module ngx\_http\_proxy\_module](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

Posted at Nginx Forum:

> **[proxy\_cache: Activity vs. Validity](https://forum.nginx.org/read.php?2,135262,135262#msg-135262)**
>
> 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;

---

<div class="post-metadata">

**Author:** ![janedenone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/da6949/32.png) [@janedenone](https://www.ruby-forum.com/u/janedenone)\
**Post date:** [September 30, 2010, 10:58am UTC](https://www.ruby-forum.com/t/proxy-cache-activity-vs-validity/195744/2 "2010-09-30T10:58:55Z")

</div>

Apologies: The working configuration did have proxy\_cache\_valid buried  
in some included file, so my post was pointless.

Posted at Nginx Forum:

> **[Re: proxy\_cache: Activity vs. Validity](https://forum.nginx.org/read.php?2,135262,135607#msg-135607)**
>
> 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;
