Welcome! Log In Create A New Profile

Advanced

proxy_cache max-size and range request

September 24, 2009 10:26AM
Hi all,

We would like to use nginx (0.8.15) as a proxy/cache for downloading big files. Wihtout configuring proxy_cache we got '206 Partial Content' for range requests. With proxy_cache the first range request (which is not in cache) will be a '200 OK' and all subsequent range requests (served by cache) are normal '206 Partial Content' responses. Is it possible to have all requests (proxied or not) would be '206 Partial Content' responses?

The wiki documentation says that "Special process cache manager controls on-disk cache size, defined by parameter max_size, and when size exceed least used data deleted." How does this "least used data" selection work in reality? We tested with the following config:

1. nginx.conf
proxy_cache_path /nginx-storage/cache levels=1:2 keys_zone=test:10m inactive=1d max_size=17m;
server {
location / {
proxy_pass http://test;
proxy_cache test;
proxy_cache_min_uses 1;
proxy_cache_valid 1d;
proxy_cache_methods GET HEAD;
proxy_cache_use_stale error timeout;
}

2. test files
# ls -lh 4m_*.bin
-rw-r--r-- 1 root root 4.0M 2009-09-24 14:29 4m_1.bin
-rw-r--r-- 1 root root 4.0M 2009-09-24 14:29 4m_2.bin
-rw-r--r-- 1 root root 4.0M 2009-09-24 14:29 4m_3.bin
-rw-r--r-- 1 root root 4.0M 2009-09-24 14:29 4m_4.bin
-rw-r--r-- 1 root root 4.0M 2009-09-24 14:29 4m_5.bin

After some test we realized that the oldest object purged and request count not matters. Is it the normal behaviour?

Regards,
Gabor Lekeny
Subject Author Posted

proxy_cache max-size and range request

leki75 September 24, 2009 10:26AM

Re: proxy_cache max-size and range request

Igor Sysoev September 24, 2009 10:58AM

Re: proxy_cache max-size and range request

leki75 September 25, 2009 03:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 59
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready