I have the following Nginx cache site.conf
file:
uwsgi_cache_path /home/ubuntu/cache levels=1:2 keys_zone=one:10m;
server {
listen 80;
server_name genelizleyici.com;
location /api/tweets/ {
uwsgi_cache one;
uwsgi_cache_valid any 1m;
uwsgi_cache_key $request_uri;
include uwsgi_params;
uwsgi_pass unix:///home/ubuntu/uwsgi.socket;
}
location / {
uwsgi_cache one;
uwsgi_cache_valid any 1m;
uwsgi_cache_key $request_uri;
include uwsgi_params;
uwsgi_pass unix:///home/ubuntu/uwsgi.socket;
}
}
It is working fine for the /api/tweets/
and the json responses are cached but the home page, (i.e. '/') is not cached.
The cache configurations are equivalent. The only difference I can think of between these two is that, the responses of the first are json
.
Any ideas why the cache configuration for /
not taken into account? Thanks.