D
D
Dmitry2016-01-21 15:21:42
Nginx
Dmitry, 2016-01-21 15:21:42

Why can't I cache?

Here is a config

proxy_cache_path /var/lib/nginx/cache/ levels=1:2 keys_zone=zone_one:10m;
proxy_set_header        Accept-Encoding "";

        location /talk {
            sub_filter_once off;
            sub_filter  '="aaa'  '="bbb';
            
            proxy_cache zone_one;
            proxy_ignore_headers Expires;
            proxy_ignore_headers Cache-Control;
            proxy_cache_valid any 30m;
            proxy_cache_key $host$uri$request_uri$is_args$args$geo;
            proxy_cache_bypass $cookie_pass_hash; 
            proxy_no_cache $cookie_pass_hash;

            add_header X-Cache-Status $upstream_cache_status;

            proxy_pass   http://127.0.0.1:8080;
        }

files are added to the cache folder, but when requested in the headers, it says
X-Cache-Status: MISS
no pass_hash cookies, gzip disabled
something else forgot?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2016-01-21
@dimasmagadan

Your cache gets a response with X-Cache-Status: MISS
Make an access_log with $upstream_cache_status;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question