Forum: NGINX question about proxy cache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ab2425ae0425be8faaf052cce737b243?d=identicon&s=25 Michał Jaszczyk (Guest)
on 2009-06-09 10:30
(Received via mailing list)
Hey,

I'm having some problems with proxy_cache. Upstream responds with
Cache-Control and Expires headers set to 30 days. My Nginx is
configured like this:

       proxy_cache_path /var/lib/storage levels=2:2
keys_zone=storage:1024m max_size=102400m;

       # unimportant stuff cut out

       location /storage {
            internal;

            rewrite ^/storage(.*)$ $1 break;

            proxy_method GET;
            proxy_pass_request_headers off;
            proxy_pass_request_body off;

            proxy_pass http://storage;

            proxy_intercept_errors on;

            proxy_cache storage;
            proxy_cache_valid 200 30d;
            proxy_cache_valid any 1h;
        }

I chose random path on my upstream (something like
/repository/data/3e960a013c9f00000000000000004a1bcf4b10f075cf0000) and
I see that Nginx accesses this path very frequently - few times a day.
I thought that the above config would make Nginx access this path only
once a month. The cache is far from being full. What am I doing wrong?

Regards,
Ab2425ae0425be8faaf052cce737b243?d=identicon&s=25 Michał Jaszczyk (Guest)
on 2009-06-10 13:08
(Received via mailing list)
2009/6/9 Michał Jaszczyk <jasiu85@gmail.com>:
>
>
> I thought that the above config would make Nginx access this path only
> once a month. The cache is far from being full. What am I doing wrong?

I found something: How exactly does "inactive" argument to
proxy_cache_path work? If inactive is set to, say, 10 minutes and
nobody downloads the file for 10 minutes, is the file deleted from
disk or only from memory?

Regards,
This topic is locked and can not be replied to.