Welcome! Log In Create A New Profile

Advanced

uwsgi_cache only caching root location

August 15, 2015 02:50PM
Hello all -

I'm having an issue where nginx is only caching homepage requests. If i send requests to my server, the HTML at the homepage is saved, but requests to any URI otherwise do not save in the cache and upstream_cache_status returns with a MISS.

How can I fix my config so that requests other than / will cache properly?


## cache zone config ##
uwsgi_cache_path /var/cache/nginx/files keys_zone=www:10m inactive=10m;
uwsgi_cache_key "$scheme$host$uri$is_args$args";

## in http block ##
map $upstream_http_content_type $no_cache {
"application/json" 1;
default 0;
}


## in server block for my vhost ##
location / {
uwsgi_cache www;
uwsgi_cache_valid 200 10m;
uwsgi_cache_methods GET HEAD;
uwsgi_no_cache $no_cache;
add_header X-uWSGI-Cache $upstream_cache_status;
include uwsgi_params;
uwsgi_pass www;
}
Subject Author Posted

uwsgi_cache only caching root location

daveyfx August 15, 2015 02:50PM

Re: uwsgi_cache only caching root location

Francis Daly August 15, 2015 05:24PM

Re: uwsgi_cache only caching root location

daveyfx August 15, 2015 07:22PM

Re: uwsgi_cache only caching root location

daveyfx August 15, 2015 09:16PM

Re: uwsgi_cache only caching root location

daveyfx August 16, 2015 01:16AM

Re: uwsgi_cache only caching root location

Francis Daly August 16, 2015 02:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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